2011-06-07 105 views
0

我需要在我的应用程序中创建选项卡我已经使用了以下工作良好...但我需要它显示为标签查看iphone如何使用android 1.6它可能吗?在此先感谢..android tabwidget需要帮助

<?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:layout_height="fill_parent" 
    android:layout_width="fill_parent"> 
    <TabWidget 
     android:id="@android:id/tabs" 
     android:layout_alignParentBottom="true" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" /> 
    <FrameLayout 
     android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:padding="5dp" /> 
</RelativeLayout> 

我已经尝试过这一点,但我的应用程序崩溃

<?xml version="1.0" encoding="utf-8"?> 
<TabHost android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:id="@android:id/tabhost" 
xmlns:android="http://schemas.android.com/apk/res/android" 
> 
<RelativeLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
> 
<TabWidget 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:id="@android:id/tabs" 
android:layout_alignParentBottom="true" 
/> 
<FrameLayout 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:id="@android:id/tabcontent" 
> 
</FrameLayout> 
</RelativeLayout> 
</TabHost> 

回答

1

我定制的Android标签看起来像iPhone UITabBar,发现这里:

或者您可以使用RadioGroup实现您自己的选项卡,但需要工作, 实施RadioGroup您可以参考this project。它使用Iphone如SegmentedControl,你可以自己使用它看起来像iphone标签。

+0

现在,前两条链接无处可去。第一次给404,第二次导致描述,但代码链接给404。死胡同。 – Bobrovsky 2013-07-26 09:53:16

+0

@Bobrovsky我更新了更多的链接。 – 2013-07-26 10:05:00