先贴上一段代码:

main.xml:

  1. <p><?xml version="1.0" encoding="utf-8"?>
  2. <TabHost xmlns:android="<a target="_blank" href="http://schemas.android.com/apk/res/android">http://schemas.android.com/apk/res/android</a>"
  3. android:id="@+id/tabhost"
  4. android:layout_width="fill_parent"
  5. android:layout_height="fill_parent" ></p><p>    <RelativeLayout
  6. android:layout_width="fill_parent"
  7. android:layout_height="wrap_content" ></p><p>        <LinearLayout
  8. android:id="@+id/tab_top"
  9. android:background="@color/red"
  10. android:orientation="horizontal"
  11. android:layout_width="fill_parent"
  12. android:layout_height="20dp"
  13. android:layout_alignParentTop="true" >
  14. </LinearLayout></p><p>        <FrameLayout
  15. android:id="@android:id/tabcontent"
  16. android:layout_width="fill_parent"
  17. android:background="@color/green"
  18. android:layout_height="wrap_content"
  19. android:layout_above="@id/tabs"
  20. android:layout_below="@id/tab_top" >
  21. </FrameLayout></p><p>        <TabWidget
  22. android:id="@+id/tabs"
  23. android:layout_width="fill_parent"
  24. android:background="@color/blue"
  25. android:layout_height="20dp"
  26. android:layout_alignParentBottom="true" >
  27. </TabWidget>
  28. </RelativeLayout></p><p></TabHost></p>

显示为如下:

这说明以<TabHost>为头的布局文件下可以很好的存在帧布局视图。在上面可放一个view,在下面可放一个选项卡去完成切换中间帧布局内容。

Android帧布局<TabHost>标签的更多相关文章

  1. Android帧布局(Frame Layout)

    Android帧布局(Frame Layout) FrameLayout是最简单的一个布局管理器.FrameLayout为每个加入其中的组件创建一个空白区域(一帧),这些组件根据layout_grav ...

  2. [android] 帧布局

    /*******************2016年5月3日 更新**************************************/ 知乎:如何理解andriod中的View和framela ...

  3. Android中帧布局-FrameLayout和网格布局-GridLayout

    帧布局-FrameLayout 一.概念 帧布局中,容器为每个加入其中的空间创建一个空白的区域(成为一帧).每个空间占据一帧,这些帧会按gravity属性自动对齐. 帧布局的效果是将其中的所有空间叠加 ...

  4. Android精通:TableLayout布局,GridLayout网格布局,FrameLayout帧布局,AbsoluteLayout绝对布局,RelativeLayout相对布局

    在Android中提供了几个常用布局: LinearLayout线性布局 RelativeLayout相对布局 FrameLayout帧布局 AbsoluteLayout绝对布局 TableLayou ...

  5. Android layout布局属性、标签属性总结大全

    RelativeLayout 第一类:属性值为true可false android:layout_centerHrizontal        水平居中 android:layout_centerVe ...

  6. 从零開始学android&lt;TabHost标签组件.二十九.&gt;

    TabHost主要特点是能够在一个窗体中显示多组标签栏的内容,在Android系统之中每一个标签栏就称为一个Tab.而包括这多个标签栏的容器就将其称为TabHost.TabHost类的继承结构例如以下 ...

  7. Android零基础入门第30节:两分钟掌握FrameLayout帧布局

    原文:Android零基础入门第30节:两分钟掌握FrameLayout帧布局 前面学习了线性布局.相对布局.表格布局,那么本期来学习第四种布局--FrameLayout帧布局. 一.认识FrameL ...

  8. Android课程---帧布局 FrameLayout

    帧布局的特点是: 1.多个组件,层叠显示 2.所占位置和大小由组件决定 示例代码: <?xml version="1.0" encoding="utf-8" ...

  9. android布局 FrameLayout(帧布局)详解

    看到一篇很有趣的文章对我就是冲着萌妹子看的 FrameLayout(帧布局) 前言 作为android六大布局中最为简单的布局之一,该布局直接在屏幕上开辟出了一块空白区域, 当我们往里面添加组件的时候 ...

随机推荐

  1. Android Studio 之 打包项目生成APK

    本文以使用Android Studio打包第一个apk的角度说明,打包APK分为两步:1生成 jks 密钥:2打包生成APK. 选择“ Build ”→选择“ Generate Signed APK. ...

  2. 微信小程序 - tab+swiper切换(非组件)

    无奈slot不支持循环,无法成为组件. 该模板适用于新闻等,点击下载示例:tabswiper

  3. vasa构架

  4. Python中字符串的Format用法。

    一.例子: "]) "_".join(map(lambda x:str(x),[1,2,3,4])) "{0}-{1}".format(3.4,34) ...

  5. Spring ActiveMQ Caused By: javax.jms.IllegalStateException: Connection closed

    根据 http://www.cnblogs.com/yshyee/p/7448808.html 进行JMS操作时,发送跟监听放到不同的项目中进行时,出现以下异常信息: org.springframew ...

  6. ngx_http_upstream_keepalive

    链接:http://wiki.nginx.org/HttpUpstreamKeepaliveModule 今天看了一些代码: upstream b_memc2 { server ; keepalive ...

  7. python2和python3网络访问包

    python3 import http.client import urllib.parse python2 import httplib import urllib

  8. 好久不git这么多问题

    本来想把本地项目上传GitHub一下,打开gitbash, git init 之前配置过了 用户名和邮箱以及ssh等 $ git remote add origin https://github.co ...

  9. 《Unix&Linux大学教程》学习笔记二:指令常识

    1:指令的本质——调用可执行程序 在Shell输入命令时,其实就是根据名称运行相应的程序. 2:在系统中查找程序 which 指令名 type 指令名 3:时间与日历 date [-选项] 参数 ca ...

  10. txt文件匹配脚本

    # -*- coding:utf-8 -*- import time start = time.clock() data=open("Data.txt","r" ...