安卓里使用TabWidget,感觉没有QT4里那样直观。
http://android.yaohuiji.com/archives/tag/tabwidget
亮点:
编写 main.xml 内容如下,这次的形式和普通布局文件有所区别,请注意看写法:
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_ |
飞机
HxLauncher: Launch Android applications by voice commands