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后面。
  • 相关阅读:
    b_lg_选学霸(并查集+01背包)
    b_lq_小明的魔法(反向思维)
    多测师课堂019_第一个月综合面试题(01) _高级讲师肖sir
    多测师课堂017_项目数据 _高级讲师肖sir
    linux whoami 显示当前用户的用户名
    linux shutdown 命令 关机 重启
    linux reboot 重启命令
    linux基础 目录
    linux uname 命令 打印系统信息
    前端 CSS层叠性 CSS选择器优先级
  • 原文地址:https://www.cnblogs.com/xiaoran1129/p/2794612.html
Copyright © 2011-2022 走看看