zoukankan      html  css  js  c++  java
  • TabHost和TabWidget写出微信下面选项卡的界面


    TabHost和TabWidget写出微信下面选项卡的界面


    xml界面代码:
    <?xml version="1.0" encoding="UTF-8"?>
    <TabHost 
      android:id="@android:id/tabhost"
      android:background="@android:color/black"
      android:layout_width="fill_parent"
      android:layout_height="fill_parent"   xmlns:android="http://schemas.android.com/apk/res/android"> <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="0.0dip"
      android:layout_weight="1.0" /> <TabWidget   android:id="@android:id/tabs"   android:visibility="gone"   android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_weight="0.0" /> <RadioGroup   android:gravity="center_vertical"
      android:layout_gravity="bottom"
      android:orientation="horizontal"
      android:id="@+id/main_tab"
      android:background="@drawable/maintab_toolbar_bg"   android:layout_width="fill_parent"
      android:layout_height="wrap_content"> <RadioButton   android:id="@+id/resourse"
      android:layout_marginTop="2.0dip"   android:text="常用资源"
      android:drawableTop="@drawable/icon_res"
      style="/@style/main_tab_bottom" /> <RadioButton   android:id="@+id/search"
      android:layout_marginTop="2.0dip"   android:text="图书搜索"
      android:drawableTop="@drawable/icon_search"
      style="/@style/main_tab_bottom" /> <RadioButton   android:id="@+id/login"   android:layout_marginTop="2.0dip"   android:text="用户登录"
      android:drawableTop="@drawable/icon_login"
      style="/@style/main_tab_bottom" /> </RadioGroup> </LinearLayout> </TabHost>
    需要注意的是<TabWidget> <TabHost> 和<FrameLayout>的Id 必须使用系统id,分别为android:id/tabs android:id/tabhost和 android:id/tabcontent 。因为系统会使用这两个id来初始化TabHost的两个实例变量(mTabWidget 和 mTabContent)。
     
    如果想让选项卡在上面,可以把FrameLayout放在TabWidget后面。
  • 相关阅读:
    在国内时,更新ADT时需要配置的
    mantis增加密码修改
    http://182.92.241.20/mypro/login 偶的点金项目细化分包管理平台即将上线!!
    bootstrap菜单完美解决---原创
    PB常用日期
    ctrl+shift+del 清理火狐缓存,解决页面显示错乱问题
    Kylin上chromium不能用flash的解决命令
    正确的SVN导入代码命令
    GNU :6.47 Function Names as Strings
    std::advance 给迭代器增加指定偏移量
  • 原文地址:https://www.cnblogs.com/xiaoran1129/p/2794612.html
Copyright © 2011-2022 走看看