zoukankan      html  css  js  c++  java
  • Android Tabhost置于底部

    方法一:

    <TabHost xmlns:android="http://schemas.android.com/apk/res/android"   
       android:id="@android:id/tabhost" android:layout_width="fill_parent"   
         android:layout_height="fill_parent">   
       <LinearLayout android:orientation="vertical"   
        android:layout_width="fill_parent" android:layout_height="fill_parent">   
          <FrameLayout android:id="@android:id/tabcontent"   
          android:layout_width="fill_parent"    
          android:layout_height="match_parent"   
          android:layout_weight="1" >    
          </FrameLayout>   
          <TabWidget android:id="@android:id/tabs"   
          android:layout_width="fill_parent"    
          android:layout_height="wrap_content" />   
        </LinearLayout>   
    </TabHost> 

    1、tabcontent和tabs交换位置
    2、tabcontent的android:layout_weight="1"

    方法二:

    <?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout 
        xmlns:android="http://schemas.android.com/apk/res/android" 
        android:orientation="vertical" 
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent"> 
        <TabHost 
            android:id="@+id/tabhost" 
            android:layout_width="fill_parent" 
            android:layout_height="fill_parent"> 
            <FrameLayout 
                android:id="@android:id/tabcontent" 
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent" 
                android:paddingBottom="62px"> 
            </FrameLayout> 
            <RelativeLayout 
                android:layout_width="fill_parent" 
                android:layout_height="fill_parent"> 
                <TabWidget 
                    android:id="@android:id/tabs" 
                    android:layout_alignParentBottom="true" 
                    android:layout_width="fill_parent" 
                    android:layout_height="60px" /> 
            </RelativeLayout> 
        </TabHost> 
    </LinearLayout> 

    1、tabcontent和tabs交换位置
    2、将tabcontent放到一个relativeLayout中,然后加上这句android:layout_alignParentBottom="true"

  • 相关阅读:
    integer比较
    String比较
    StringBuffer的s1.capacity()是多少?
    时间复杂度
    京东面试--总结
    说下Java堆空间结构,及常用的jvm内存分析命令和工具
    linux下jmap,jstat和jstack使用
    jvm 性能调优工具之 jmap
    jstack(查看线程)、jmap(查看内存)和jstat(性能分析)命令
    android小技巧:在activity中实现与绑定的fragment的回调
  • 原文地址:https://www.cnblogs.com/weizilong/p/3291818.html
Copyright © 2011-2022 走看看