ダイアログ内に表示するために使用する以下のxmlコードがあります。問題は、「Easy」の文字「E」がラジオボタン自体の下に表示されることです。したがって、表示されません。何故ですか?残りは、対応する各RadioButtonの右側に正しく表示されます。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:id="@+id/radioBtnEasy"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Easy"
android:layout_weight="1" />
<RadioButton
android:id="@+id/radioBtnMedium"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:checked="true"
android:text="Medium"
android:layout_weight="1" />
<RadioButton
android:id="@+id/radioBtnHard"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:text="Hard"
android:layout_weight="1" />
</RadioGroup>
編集
Padma Kumarの要求に応じて、残りのコードを投稿します。これが私がダイアログを表示する方法です。ダイアログの幅を画面の幅に合わせて作成し、コンテンツを折り返さないようにしました。これを削除しましたが、それでもEasyテキストが正しく表示されませんでした。
//Define a new dialog window
Dialog dialog = new Dialog(this);
//Load the predefined layout onto this dialog
dialog.setContentView(R.layout.new_session_dialog);
//Set title of dialog
dialog.setTitle("Create new session");
//Set the width of the dialog to fill the width of the screen
dialog.getWindow().setLayout(WindowManager.LayoutParams.FILL_PARENT, WindowManager.LayoutParams.WRAP_CONTENT);
//Show the dialog
dialog.show();