http://bakhtiyor.com/2009/10/iphonish-tabs/に投稿された例を調べていましたが、実際には、Tabviewの代わりにラジオボタンを配置しています。
しかし、問題は、画像を中央に設定できないことです。その常に左に揃えられます。
これがスクリーンショットです。ビューをこのようにしたいのですが、代わりに画像を中央に配置したいと思います。
これが私のレイアウトXMLファイルの外観です
<?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">
<FrameLayout android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="20dip"/>
<RadioGroup android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:checkedButton="@+id/allcontacts"
android:gravity="center"
android:id="@+id/contactgroup">
<RadioButton android:id="@+id/allcontacts"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:background="@drawable/button_radio"/>
<RadioButton
android:id="@+id/categories"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@drawable/button_radio"
android:orientation="vertical"
android:layout_gravity="center|right"/>
<RadioButton android:id="@+id/favourites"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="vertical"
android:layout_weight="1"
android:background="@drawable/button_radio"/>
</RadioGroup>
<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>
アドバイスしてください
デフォルトのタブウィジェットを使用した後の更新された画像
デフォルトのタブビューで上記のラジオボタンのようにカスタマイズすることは可能ですか?