2011-06-07 103 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