zoukankan      html  css  js  c++  java
  • android开发之如何使TabHost的TabWidget位于屏幕下方

    更改TabHost里的第一个LinearLayout为RelativeLayout。并在TabWidget中添加android:layout_alignParentBottom="true" 

    <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity" >

    <TabHost
    android:id="@android:id/tabhost"
    android:layout_width="match_parent"
    android:orientation="vertical"
    android:layout_height="match_parent" >

    <RelativeLayout
    android:id="@+id/RelativeLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    >

    <TabWidget
    android:id="@android:id/tabs"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true" >
    </TabWidget>

    <FrameLayout
    android:id="@android:id/tabcontent"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" >

    <LinearLayout
    android:id="@+id/tab1"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    </LinearLayout>

    <LinearLayout
    android:id="@+id/tab2"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    </LinearLayout>

    <LinearLayout
    android:id="@+id/tab3"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    </LinearLayout>
    <LinearLayout
    android:id="@+id/tab4"
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
    </LinearLayout>
    </FrameLayout>
    </RelativeLayout>
    </TabHost>

    </FrameLayout>

  • 相关阅读:
    二叉树的遍历
    数据结构
    POJ 2054 Color a Tree (贪心)
    $2019$ 暑期刷题记录 $2$(基本算法专题)
    POJ 3889 Fractal Streets(逼近模拟)
    POJ 2018 Best Cow Fences (二分答案构造新权值 or 斜率优化)
    CH5E26 扑克牌 (计数类DP)
    BZOJ 1911 特别行动队 (斜率优化)
    BZOJ 1233 干草堆 (单调队列优化DP)
    POJ 1038 Bugs Integrated Inc (复杂的状压DP)
  • 原文地址:https://www.cnblogs.com/jyycnblogs/p/5032333.html
Copyright © 2011-2022 走看看