StupidBeauty
Read times:554Posted at:Thu Mar 28 04:48:12 2013
- no title specified

转载:第四十四讲:用户界面 View(十一)

安卓里使用TabWidget,感觉没有QT4里那样直观。

http://android.yaohuiji.com/archives/tag/tabwidget

亮点:

编写 main.xml 内容如下,这次的形式和普通布局文件有所区别,请注意看写法:

view source

print ?

01

<?xml version="1.0" encoding="utf-8"?>

02

<!-- 根元素是 TabHost ,我们这个文件要和TabActivity配合使用,在TabActivity的源代码里写死了要找的Id是android.R.id.tabhost,

03

因此这里的ID也要定死成TabHost 的ID 是定死的 "@android:id/tabhost" 下面的类似,不再解释。 -->

04

<tabhost android:layout_height="fill_parent" android:layout_width="fill_parent" xmlns:android=" http://schemas.android.com/apk/res/android " android:id="@android:id/tabhost">

05

06

<!-- TabWidget 就是标签选项卡的头部部分,注意ID的写法 -->

07

<tabwidget android:layout_height="wrap_content" android:layout_width="fill_parent" android:id="@android:id/tabs">

08

</tabwidget>

09

<!-- FrameLayout 就是标签的内容显示部分,注意ID的写法,还要注意我们做了个上部空白设定 android:paddingTop="65dp",是为了不让内容和标签重叠 -->

10

<framelayout android:layout_height="fill_parent" android:layout_

飞机

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4