2011-02-09 93 views

回答

1
<?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"> 
    <LinearLayout android:orientation="vertical" 
    android:layout_width="fill_parent" android:layout_height="fill_parent"> 
    <RadioGroup android:layout_width="fill_parent" 
     android:layout_height="wrap_content" android:orientation="horizontal" 
     android:checkedButton="@+id/first" android:id="@+id/states"> 
     <RadioButton android:id="@+id/first" android:background="@drawable/button_radio" 
     android:width="80dip" android:height="70dip" /> 
     <RadioButton android:id="@+id/second" android:background="@drawable/button_radio" 
     android:width="80dip" android:height="70dip" /> 
     <RadioButton android:id="@+id/third" android:background="@drawable/button_radio" 
     android:width="80dip" android:height="70dip" /> 
     <RadioButton android:id="@+id/fourth" android:background="@drawable/button_radio" 
     android:width="80dip" android:height="70dip" /> 
    </RadioGroup> 
    <FrameLayout android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent" android:layout_height="0dip" 
     android:layout_weight="1" android:padding="20dip" android:background="#fff"/> 
    <TabWidget android:id="@android:id/tabs" 
     android:layout_width="fill_parent" android:layout_height="wrap_content" 
     android:layout_weight="0" android:visibility="gone" /> 
    </LinearLayout> 
</TabHost> 

只有兩個意見:

  • iPhone標籤很爛......不,對不起,我的意思是:iPhone標籤SUCKS。事實上,標籤很糟糕。
  • 在嘗試做這樣的事情之前閱讀UI基礎。如您所見,您只需更改LinearLayouts子項的順序。
+1

你爲什麼似乎在說所有的標籤吸?你能詳細說明嗎?我在我的應用程序中使用了選項卡,不像這種方法,而只是使用Android提供的TabHost和TabWidget。我也喜歡iPhone標籤的外觀,並且我個人認爲標籤如果能夠幫助用戶界面流動的話,它們就有它的位置。 – 2011-02-09 20:43:32

相關問題