Android:实现TabWidget选项卡按钮在屏幕下方

来源:HELP 责任编辑:栏目编辑 发表时间:2013-07-01 11:14 点击:

看到很多热门的Android程序(如:新浪微博、腾讯微博、京东商城、淘宝、当当等等)使用选项卡风格作为程序界面的主框架结构,而 Android的选项卡控件默认是按钮在上方的。我在网上看到有多种实现方法,这里提供一种个人觉得比较简单的。由于我对Android开发所知甚少,方 法的优劣目前不好评价,欢迎各位提供更好的思路。

 

 

 

主要原理:设置 TabWidget 控件的 android:layout_alignParentBottom="true" 实现。

 

main.xml
 
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <TabHost android:id="@+id/tabhost" xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:orientation="vertical" android:layout_width="fill_parent"  
  4.     android:layout_height="fill_parent">  
  5.     <RelativeLayout android:orientation="vertical"  
  6.         android:layout_width="fill_parent" android:layout_height="fill_parent">  
  7.         <TabWidget android:id="@android:id/tabs"  
  8.             android:layout_width="fill_parent" android:layout_height="wrap_content"  
  9.             android:layout_alignParentBottom="true" />  
  10.         <

      相关新闻>>

      发表评论
      请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
      用户名: 验证码:点击我更换图片
      最新评论 更多>>

      推荐热点

      • Lexical or Preprocessor Issue 'xxx.h
      • ios学习笔记(二)xcode 4.3.2下实现基本交互
      • ios版本的helloworld
      • iphone(object-c) 内存管理(3) 有效的内存管理 前半部分
      • ios学习笔记(一)xcode 4.3.2下创建第一个ios项目
      • IOS类似iphone通讯录TableView的完整demo【附源码】
      • UITableView一些方法
      • [iPhone中级]iPhone团购信息客户端的开发 (二)
      • 如何为Iphone应用创建启动界面
      网站首页 - 友情链接 - 网站地图 - TAG标签 - RSS订阅 - 内容搜索
      Copyright © 2008-2015 计算机技术学习交流网. 版权所有

      豫ICP备11007008号-1