你好,游客 登录 注册 搜索
背景:
阅读新闻

Android中实现底部Tabhost【附源码】

[日期:2012-06-18] 来源:Linux社区  作者:ericchan2012 [字体:大 中 小]

这个是主类
再看看主布局文件:

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <TabHost xmlns:Android="http://schemas.android.com/apk/res/android"  
  3.    android:id="@android:id/tabhost"  
  4.    android:layout_width="fill_parent"  
  5.    android:layout_height="fill_parent">  
  6.       
  7.    <LinearLayout    
  8.       android:orientation="vertical"  
  9.       android:layout_width="fill_parent"  
  10.       android:layout_height="fill_parent">  
  11.       <FrameLayout  
  12.          android:id="@android:id/tabcontent"  
  13.          android:layout_width="fill_parent"  
  14.          android:layout_height="wrap_content"  
  15.          android:layout_weight="1">  
  16.       </FrameLayout>  
  17.       <TabWidget  
  18.          android:id="@android:id/tabs"  
  19.          android:layout_width="fill_parent"  
  20.          android:layout_alignParentBottom="true"  
  21.          android:layout_height="wrap_content"/>     
  22.     </LinearLayout>  
  23. </TabHost>  

这样,基本上一个可用的tabhost就可以了。

附件是代码

免费下载地址在 http://linux.linuxidc.com/

用户名与密码都是www.linuxidc.com

具体下载目录在 /2012年资料/6月/18日/Android中实现底部Tabhost【附源码】/

linux
相关资讯       Android开发入门 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款