2012-07-18 4 views
1

대화 상자 안에 표시 할 때 사용하는 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(); 
+1

고정 폭으로 시도하십시오. – Jayabal

+0

단순히이 공간을 넣으세요 android : text = "Easy"다른 해결책도 있습니다.하지만이 방법으로 패딩과 같은 다른 안드로이드 태그를 선택하지 않아도됩니다. –

+0

코드가 잘 작동합니다. 당신이 거기에 추가하는 내용을 게시하십시오. –

답변

1

가 안드로이드를 사용 EMS는 속성하지만 모든 밀도 장치 0dp 폭이 가장 가능성이 문제입니다

0

layout_weight = 1을 먼저 제거하고 fill_parent를 RadioButton 너비에 넣으십시오. 그런 다음 필요한 조정을하십시오.

1

에 텍스트를 관리

첫 번째 문자 "E"가 표시되지 않는 그렇지 않은 경우

, 쉬운 전에 공간을 넣으십시오. 대신

예) "쉬운" "쉬운"이 질문을 게시

1

감사했습니다. 나는 같은 문제에 부딪쳤다 : 첫 번째 라디오 버튼의 아이콘은 그 뒤의 텍스트의 첫 글자를 눌렀다. Android 1.6 에뮬레이터를 사용하고 있습니다. 내 앱을 설치 한 후 내 앱을 시작하고 라디오 그룹을 표시하면 문제가 발생합니다. 그러나 뒤로 키를 사용하여 나를 홈 화면으로 다시 가져와 내 앱을 시작하고 라디오 그룹을 다시 표시 할 때 문제가 보이지 않습니다.

관련 문제