欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

选项卡 都是显示在页面底部

发布时间:2025/7/14 编程问答 63 豆豆
生活随笔 收集整理的这篇文章主要介绍了 选项卡 都是显示在页面底部 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

 

  • <?xml version="1.0" encoding="utf-8"?> 
  • <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"> 
  •   <!-- 实现Tab标签的居底主要是通过设置属性 android:layout_weight="1" --> 
  •   <!-- 还要注意FrameLayout标签的位置,要写在TabWidget标签的前面 --> 
  •   <FrameLayout 
  •    android:id="@android:id/tabcontent" 
  •    android:layout_weight="1"   
  •    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="wrap_content" /> 
  •  </LinearLayout> 
  • </TabHost> 
  •  
  •  
  •  <!-- 实现Tab标签的居底主要是通过设置属性 android:layout_weight="1" -->
    <!-- 还要注意FrameLayout标签的位置,要写在TabWidget标签的前面 -->

    转载于:https://blog.51cto.com/whatandroid/1007107

    总结

    以上是生活随笔为你收集整理的选项卡 都是显示在页面底部的全部内容,希望文章能够帮你解决所遇到的问题。

    如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。