关于android tab分页的问题 现在做一个TAB分页式菜单,我想改善一下布局,把tab放到下方,不知道有哪位同学做过?类似于这个效果:http://www.sisou.cn/read-htm-tid-451.html 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 他用的不是TAB控件吧,好像是4个button来切换主界面吧, 不知道他用的是不是button;我要做的是tab,但不知道怎么让它在下方显示。 我觉得应该要修改Framework层的东西可以实现这个功能。 我看过了那个的确不是用Tab这个空间做的它就是利用简单的TextView集成Button控件来完成的 Framework层的东西怎么改啊 ,请问? <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <RelativeLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"android:layout_alignParentBottom="true" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:id="@+id/textview1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="this is a tab" /> <TextView android:id="@+id/textview2" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="this is another tab" /> <TextView android:id="@+id/textview3" android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="this is a third tab" /> </FrameLayout> </RelativeLayout> </TabHost> 他们用的是menu 我做过实例 menu?不能直接显示,那需要点击menu键才会出现的吧?而且menu一排不能显示多于三个;不过我有用button实现的:<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/mPath_1" android:padding="5px" android:textSize="18sp" android:textColor="@drawable/white" /> <ListView android:id="@+id/android:list" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0" /> <LinearLayout style="@android:style/ButtonBar" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/button_library_1" android:text="@string/menu1" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> <Button android:id="@+id/button_picture_1" android:text="@string/menu2" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> <Button android:id="@+id/button_audio_1" android:text="@string/menu3" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> <Button android:id="@+id/button_notes_1" android:text="@string/menu4" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> <Button android:id="@+id/button_settings_1" android:text="@string/menu5" android:layout_width="0dip" android:layout_height="wrap_content" android:layout_weight="1" /> </LinearLayout></LinearLayout> 用的是ActivityGroup + GridView 实现Tab分页标签吧 参考下http://blog.csdn.net/hellogv/archive/2010/12/06/6057174.aspx android:如何拆分不规则字符串? 如何完全退出程序 请问一下,一般安卓应用开发的层? git下载android出错 Service的问题 真机Nexus4,adb shell 问题:device not found android自定义控件及特效资料 Android多线程同步问题 如何取消蓝牙配对对话框 android 如何执行大批量post请求? 他们的结算率到底咋样啊! 求解:不规则图片响应点击事件问题
我要做的是tab,但不知道怎么让它在下方显示。
Framework层的东西怎么改啊 ,请问?
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
/>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:id="@+id/textview1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is a tab" />
<TextView
android:id="@+id/textview2"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is another tab" />
<TextView
android:id="@+id/textview3"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="this is a third tab" />
</FrameLayout>
</RelativeLayout>
</TabHost>
menu?不能直接显示,那需要点击menu键才会出现的吧?
而且menu一排不能显示多于三个;不过我有用button实现的:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@+id/mPath_1"
android:padding="5px" android:textSize="18sp" android:textColor="@drawable/white" /> <ListView android:id="@+id/android:list"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1.0" /> <LinearLayout style="@android:style/ButtonBar"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="horizontal">
<Button android:id="@+id/button_library_1" android:text="@string/menu1"
android:layout_width="0dip" android:layout_height="wrap_content"
android:layout_weight="1" />
<Button android:id="@+id/button_picture_1" android:text="@string/menu2"
android:layout_width="0dip" android:layout_height="wrap_content"
android:layout_weight="1" />
<Button android:id="@+id/button_audio_1" android:text="@string/menu3"
android:layout_width="0dip" android:layout_height="wrap_content"
android:layout_weight="1" />
<Button android:id="@+id/button_notes_1" android:text="@string/menu4"
android:layout_width="0dip" android:layout_height="wrap_content"
android:layout_weight="1" />
<Button android:id="@+id/button_settings_1" android:text="@string/menu5"
android:layout_width="0dip" android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>