【发布时间】:2014-05-23 21:37:54
【问题描述】:
我想将底部标签栏显示为 MAC 系统停靠菜单
如何在android中实现这个停靠菜单
【问题讨论】:
标签: android
我想将底部标签栏显示为 MAC 系统停靠菜单
如何在android中实现这个停靠菜单
【问题讨论】:
标签: android
TabHost 没有提供太多工具来定制那里的布局。所以我做了什么,我创建了一个我想要的布局,结合 ImageView 并将它的点击转移到相对 TabWidget。我创建了如下布局。
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"/>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="fill_horizontal">
<include
android:id="@+id/customtab"
layout="@layout/customtablayout"/>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="invisible"
android:layout_weight="0" />
</FrameLayout>
</LinearLayout>
这里customtablayout 是我的布局,带有图像作为选项卡(您可以添加 anithing)。当我点击一张图片时,我打电话给tabHost.setCurrentTab(index);。
【讨论】:
您可以检查(标签带有图像):How to change the Tabs Images in the TabHost
您对图像应用镜像效果
【讨论】: