位置: 编程技术 - 正文

android TabHost小结(android navigation bar)

编辑:rootadmin

推荐整理分享android TabHost小结(android navigation bar),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:安卓 localhost,android filehost,android.support.design.widget.tablayout,android filehost,androidhomepage,安卓 localhost,安卓 localhost,android.support.design.widget.tablayout,内容如对您有帮助,希望把文章链接给更多的朋友!

转载:

TabHost是整个Tab的容器,包括两部分,TabWidget和FrameLayout。TabWidget就是每个tab的标签,FrameLayout则是tab内容。

android TabHost小结(android navigation bar)

1、如果我们使用extends TabAcitivty,如同ListActivity,TabHost必须设置为@android:id/tabhost 2、TabWidget必须设置android:id为@android:id/tabs 3、FrameLayout需要设置android:id为@android:id/tabcontent 4、参考这儿:<a href=" http:="" www.2cto.com="" kf="" web="" asp="" "="" target="_blank" class="keylink" style="color: rgb(, , ); text-decoration: none;">aspx"> Java代码 <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns: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="fill_parent" android:layout_weight="1.0" android:paddingBottom="px"/> <TabWidget android:id="@android:id/tabs" android:layout_alignParentBottom="true" android:layout_width="fill_parent" android:layout_height="px" android:visibility="gone" android:layout_weight="0.0"/> <RadioGroup android:gravity="center_vertical" android:orientation="horizontal" android:id="@&#;id/main_radio" android:background="@drawable/radiogroup_background" android:layout_width="fill_parent" android:layout_height="dip" android:layout_gravity="bottom"> <RadioButton android:id="@&#;id/main_index_button" android:layout_marginTop="1.0dip" android:layout_marginRight="5dip" android:text="@string/main_name" android:drawableTop="@drawable/unistall" style="@style/main_tab_bottom" android:background="@drawable/radio_bg"/> <RadioButton android:id="@&#;id/main_running_button" android:layout_marginTop="1.0dip" android:layout_marginRight="5dip" android:text="@string/run_manager_name" android:drawableTop="@drawable/unistall" style="@style/main_tab_bottom" android:background="@drawable/radio_bg"/> <RadioButton android:id="@&#;id/main_uninstall_button" android:layout_marginTop="1.0dip" android:text="@string/uninstall_manager_name" android:drawableTop="@drawable/unistall" style="@style/main_tab_bottom" android:background="@drawable/radio_bg"/> </RadioGroup> </LinearLayout> </TabHost>

为了让tabHost显示在下方,要将RadioGroup的layout_gravity设置为bottom,再将FrameLayout的layout_weight设置为1,这样就可以将RadioGroup撑到最下方。style="@style/main_tab_bottom"里面定义了样式文件。

接下来就是在activity中初始化并添加tabhost: Java代码 tabHost = (TabHost) findViewById(android.R.id.tabhost); tabHost.addTab(Constant.tabHost.newTabSpec("Main") .setIndicator(getString(R.string.main_name),null) .setContent(new Intent(this, Main.class))); tabHost.addTab(Constant.tabHost.newTabSpec("RunManager") .setIndicator(getString(R.string.run_manager_name),null) .setContent(new Intent(this, RunManager.class))); tabHost.addTab(Constant.tabHost.newTabSpec("UninstallManager") .setIndicator(getString(R.string.uninstall_manager_name),null) .setContent(new Intent(this, UninstallManager.class)));

初始化每个RadioButton并为其添加setOnCheck

android 判断切换后台 判断按下home键 写这个博客不是为了实现监听home键,而是判断切换后台,说过不写一些没意思的博客,监听home键或者屏蔽home键的方法,请百度。我这个篇博客只是想

Android—如何查看android源码 我是根据以下文章来查看声明:高手跳过此文章当我们在eclipse中开发android程序的时候,往往需要看源代码(可能是出于好奇,可能是读源码习惯),那

Android广告轮播图效果实现 效果如下:首先看下一下布局文件:RelativeLayoutxmlns:android="

标签: android navigation bar

本文链接地址:https://www.jiuchutong.com/biancheng/385947.html 转载请保留说明!

上一篇:android自定义属性三部曲(android 自定义style)

下一篇:android 判断切换后台 判断按下home键(android局部界面切换)

  • 企业购买银行理财的条件
  • 公司两年账没做
  • 国税 增值税
  • 子公司分红母公司缴税吗
  • 增值税加计扣除账务处理
  • 预收款结转收入怎么算
  • 控股合并的会计准则
  • 商业企业向供货方收取的进场费,不可以开具增值税发票
  • 其他业务收入的核算内容
  • 未确认融资费用借贷方向
  • 收到的出口退税款一直有余额吗
  • 部门独立核算管理制度
  • 公司把贷款的钱转给个人
  • 金税盘820的抵扣联怎么装订?
  • 购买国债逆回购有股东限制
  • 印花税按次申报怎么报
  • 西部大开发政策2020到期
  • 税务部门实名认证
  • 酒店装修费用会计处理
  • 固定资产净残值是什么意思
  • mac如何搜索
  • dhcp的安全防范
  • 没有系统U盘,电脑密码忘记了如何打开电脑
  • 反避税的意义
  • 废料收入应如何确定
  • 非上市公司转让股权需要缴纳增值税吗
  • 工资薪金与劳务报酬的区别有哪些
  • 银行承兑汇票背书人和被背书人什么关系
  • 固定资产一次性扣除后第二年账务处理
  • php使用js
  • 企业合并支付的资产评估费计入
  • 固定资产清理的会计科目处理
  • 小规模附加税费
  • php中自定义函数的语法格式
  • node使用axios
  • 房地产停车场属于公共配套设施吗
  • 小企业会计准则和一般企业会计准则的区别
  • 财务费用包括什么利息
  • 多付款退回怎样写说明
  • 车辆购置税能否融资租赁
  • 自产和外购用于赠送
  • 综合所得算税公式
  • 变卖固定资产的账务处理
  • 微信账单可以用来干嘛
  • 国税申报流程怎么操作的
  • 增值税留底注销时怎么办
  • 从内地到香港坐飞机到国内
  • 无法收回的款项
  • 长期股权投资的账务处理
  • 应收账款转营业外支出
  • 金税盘里显示有报税资料怎么处理
  • 虚开发票如何界定?
  • 年初建账考虑要点有哪些
  • 新公司怎样
  • mysql 去除重复查询结果
  • win10系统环境设置
  • 安装最新的Google应用
  • win10分辨率2560*1080
  • 怎么改windowsxp版本
  • linux版本ubuntu
  • linux中的mv命令是什么意思
  • linux编译安装php扩展
  • 在linux系统中有一个重要的概念
  • 解决胃胀气最快方法
  • Lesson02_05 头元素
  • 简单的jquery插件实例
  • 微软官方app
  • unity协程执行顺序
  • Node.js中的核心模块包括哪些内容?
  • linux shell函数
  • js状态管理
  • 使用jquery操作dom
  • jquery基础知识梳理
  • 河南电子税务局官网app
  • 境外承包工程款收入
  • 重庆地方税务局电子税务局官网
  • 国家税务总局公告2017年第21号
  • 建设工程勘察设计单位可跨部门跨地区承揽勘察设计业务
  • 晋阳学堂实验学校学费多少钱
  • 审计如何配合教师工作
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设