2011-03-28 21 views
0

ラジオボタンのように機能する必要がある図に示すようなカスタムビューを作成する必要があります。いずれのオプションも選択する必要があります。どうすればこれを達成できますか?私は一連のボタンを使いたくない。カスタムビューin android/

enter image description here

+0

ここから始めることができます:http://developer.android.com/guide/topics/ui/custom-components.html – mudit

+0

TabHostを試してみてください。ここにtabhost [ここ]の例があります(http: //www.androidpeople.com/android-tabhost-tutorial-part-1/)... –

答えて

0

あなたはこれを達成するためにRADIOGROUPとのRadioButtonを使用することができます。たとえば、

<RadioButton 
android:id="@+id/custom_btn" 
android:layout_width="wrap_content" 
android:layout_height="wrap_content" 
android:text="1" 
android:button="@null" 
android:background="@drawable/button_custom"/> 

ここで、button_customは、表示されるボタンの背景イメージです。この画像には、すべてのバリエーション(通常、押し、有効、無効、選択)が含まれている必要があります。