대화 상자 안에 표시 할 때 사용하는 XML 코드가 아래에 있습니다. 문제는 라디오 버튼 자체 아래에 "Easy"의 문자 "E"가 표시된다는 것입니다. 그래서 그것은 보이지 않습니다. 왜 그런가요? 나머지는 각 해당 RadioButton의 오른쪽에 올바르게 표시됩니다.Android. 라디오 버튼 텍스트가 올바르게 표시되지 않습니다.
<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>
파드마 쿠마의 요청에 따라 편집
, 나는 코드의 나머지 부분을 게시 할 수 있습니다. 이것은 대화 상자를 표시하는 방법입니다. 대화 상자의 너비를 화면의 너비에 맞추고 내용을 둘러싸 지 않게했습니다. 이것을 제거했지만 여전히 쉬운 텍스트가 잘못 표시되었습니다.
//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();
고정 폭으로 시도하십시오. – Jayabal
단순히이 공간을 넣으세요 android : text = "Easy"다른 해결책도 있습니다.하지만이 방법으로 패딩과 같은 다른 안드로이드 태그를 선택하지 않아도됩니다. –
코드가 잘 작동합니다. 당신이 거기에 추가하는 내용을 게시하십시오. –