내 Custom RadioButton을 확장하고 만드는 것 외에 다른 방법으로 RadioGroup의 RadioButton 아래에 TextView를 추가 할 수 있습니까?RadioGroup의 TextView가있는 RadioButton
7
A
답변
5
예, 가능합니다. 아래를 참조
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RadioGroup
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn1" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="btn2" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="sample text" />
</RadioGroup>
</LinearLayout>
샘플 출력 :
0
XML에서 RadioGroup을 제거하고 라디오 버튼을 하나씩 추가 할 수 있습니다. 보기 :
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RadioButton
android:id="@+id/radioButton1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/radioGroup1"
android:text="RadioButton" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/radioButton1"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<RadioButton
android:id="@+id/radioButton2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/textView1"
android:layout_below="@+id/textView1"
android:text="RadioButton" />
</RelativeLayout>
+0
예,하지만 내가 그룹과 같은 RadioButtons를 작동하지 않을 수 있다고 생각 DNT - 자신의 RadioButton 메커니즘으로 코딩을 많이 포함하는이 ... – Michal
0
난 당신이 다른 까다로운 솔루션을 사용할 수 있다고 생각합니다. 안쪽 여백이나 여백을 사용하여 두 개의 라디오 버튼 사이에 간격을 만들고 간격에 textView를 놓습니다.
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RadioGroup
android:id="@+id/radioGroup1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="78dp" >
<RadioButton
android:id="@+id/radio0"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:checked="true"
android:text="RadioButton"
android:layout_marginBottom="100dp"/>
<RadioButton
android:id="@+id/radio1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton"
android:layout_marginBottom="100dp"/>
<RadioButton
android:id="@+id/radio2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="RadioButton" />
</RadioGroup>
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/radioGroup1"
android:layout_centerHorizontal="true"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:layout_alignParentTop="true"
android:layout_marginTop="200dp"/>
</RelativeLayout>
+0
아니, 작동하지, center_horizontal 제거하려고 ... 화면의 상단과 자체 정렬 ... – Michal
관련 문제
- 1. RadioGroup의 RadioGroup (코드로 생성)을 android에 정렬하십시오.
- 2. ImageView 및 TextView가있는 SimpleCursorAdapter
- 3. 아래쪽에 TextView가있는 FrameLayout
- 4. Android RadioGroup의 선택된 색인 설정
- 5. radiogroup의 selectedindex를 sharedpreferences에 저장하는 방법
- 6. 이 나쁜 주주인가요? (RadioGroup의 RadioButton과 어울리는 Button을 얻는 것)?
- 7. RadioButton 모양
- 8. MVC3 RadioButton
- 9. RadioButton Image
- 10. 두 개의 TextView가있는 사용자 정의 버튼
- 11. 안드로이드 RadioButton 텍스트가 처음에 잘리는 이유는 무엇입니까?
- 12. RadioButton 단추 스타일 XAML
- 13. Android RadioButton 디스플레이
- 14. ListView에 radioButton 추가
- 15. 두 줄의 Android RadioButton
- 16. Android에서 RadioButton 출력
- 17. 단일의 RadioButton 선택의 GridView
- 18. jQuery RadioButton 인덱스
- 19. .Net Radiobutton 클래스
- 20. RadioButton-CheckBox Combo
- 21. RadioButton Repeater asp.net
- 22. WPF Databound RadioButton ListBox
- 23. RadioButton 상태를 읽는 방법
- 24. Silverlight 조건부 CheckBox/RadioButton
- 25. android radiobutton array
- 26. RadioButton 열을 만드는 DataGrid
- 27. jquery div & radiobutton viewstate
- 28. XamlReader.Parse 및 RadioButton GroupName
- 29. 의 RadioButton 텍스트
- 30. YUI Radiobutton ASP.Net oncheckedchanged
내가 그렇게 .. –