2012-01-06 8 views
-1

に出入りしていることは私のコード私のラジオボタンは、私がここで、相対的なレイアウト内のラジオボタンを使用しています画面

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" android:layout_height="fill_parent" > 

<FrameLayout android:id="@+id/frameLayout" android:layout_width="fill_parent" 
    android:layout_height="fill_parent" android:layout_alignParentTop="true" 
    android:layout_above="@+id/radioButtonGroupLayout"> 
<!-- Put fragments dynamically --> 

</FrameLayout> 


<RadioGroup android:id ="@+id/radioButtonGroupLayout" android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="horizontal" android:layout_alignParentBottom="true"> 

    <RadioButton android:id="@+id/RadioButton1" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:button="@drawable/ip4_menu_but_1_selector" android:background="@drawable/ip4_menu_background_short72"/> 
    <RadioButton android:id="@+id/RadioButton2" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:button="@drawable/ip4_menu_but_2_selector" android:background="@drawable/ip4_menu_background_short72"/> 
    <RadioButton android:id="@+id/RadioButton3" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:button="@drawable/ip4_menu_but_3_selector" android:background="@drawable/ip4_menu_background_short72"/> 
    <RadioButton android:id="@+id/RadioButton4" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:button="@drawable/ip4_menu_but_4_selector" android:background="@drawable/ip4_menu_background_short72"/> 
    <RadioButton android:id="@+id/RadioButton5" 
     android:layout_width="wrap_content" android:layout_height="wrap_content" 
     android:button="@drawable/ip4_menu_but_5_selector" android:background="@drawable/ip4_menu_background_short72"/> 
</RadioGroup> 
</RelativeLayout> 

最後のラジオボタンが画面上にないです。私は最初の4つのラジオボタンと最後のものだけを見ることができます。私のコードで何が間違っていますか?

+0

スクリーンショットを表示できますか?ラジオボタンにwrap_contentを使用しているため、ボタンとバックグラウンドで使用しているドロワーブラスと同じ大きさのものを表示している可能性があります。これらの高さと幅を固定されたdpに変更することをお勧めします。 –

+0

マイケルに感謝します。イメージのサイズを変更しました。スペースを割り当てるために、すべてのラジオボタンにlayout_weight = "1"を追加しました..その作業...すべてのあなたの助けをありがとうございます – Nik

+1

スクロールビュー内のすべてを入れ子にしてみてください。 – Ghost

答えて

0

ボタンと背景に使用しているドロワーブラスと同じ大きさのラジオボタンを表示すると、wrap_contentを使用している可能性があります。これらの高さと幅を固定されたdpに変更することをお勧めします。

質問を終了できるようにこのコメントを回答として追加しました。

0

各ラジオボタンでandroid:layout_weight = "1"を使用します。任意のサイズの画面に5つのボタンがすべて表示されます。

<RadioButton 
     android:id="@+id/RadioButton1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_weight="1" /> 

すべてのラジオボタンで同じ操作をしてください。

関連する問題