如何使用文本右側的選項創建RadioButton
?Android文本右側的RadioButton選項
5
A
回答
4
這沒關係,我用CheckTextView代替
1
像@Arutha mentioned in the above answer,你可以使用一個CheckedTextView
。這可以通過使用內置的Android的佈局(如我貼here)來完成 - android.R.layout.simple_list_item_single_choice
:
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 The Android Open Source Project
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<CheckedTextView
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/text1"
android:layout_width="match_parent"
android:layout_height="?android:attr/listPreferredItemHeightSmall"
android:textAppearance="?android:attr/textAppearanceListItemSmall"
android:gravity="center_vertical"
android:checkMark="?android:attr/listChoiceIndicatorSingle"
android:paddingStart="?android:attr/listPreferredItemPaddingStart"
android:paddingEnd="?android:attr/listPreferredItemPaddingEnd" />
如果要修改它,你可以在上面的複製粘貼到一個新的XML文件,然後使用<include>
標籤將其包含在其他佈局中(在Apache 2.0 License下)。您也可以將它用作列表項目,並保持不變。
相關問題
- 1. LinearLayout的左側是TextView,右側是RadioButton?
- 2. ListField中文本右側的複選框
- 3. Android中CheckBox右側的文本
- 4. 文本對齊左側的文本和右側的文本
- 5. 元素左側和右側的文本
- 6. 在Android上有一個邊距的RadioButton文本左側
- 7. Android TextView右側
- 8. UIToolBar左側/右側按鈕文本
- 9. IE截斷文本右側
- 10. 右側列表中的Android複選框
- 11. Android TextView將文本對齊到右側和左側
- 12. Android。佈局項移動到右側
- 13. TabControl c的右側和左側的選項卡#
- 14. Android列表項:左側的TextView,右側的圖片
- 15. Android NavigationView從右側
- 16. 手風琴中的選項卡左側和內容右側
- 17. 在Android中更改Gridview右側副本
- 18. 如何讓新的文檔選項卡出現在右側?
- 19. 在右側的EditView中顯示文本
- 20. 從文本框的右側鍵入
- 21. Div內的文本卡在右側
- 22. 在div的右側放置文本
- 23. 顯示文本右側的視圖
- 24. ToogleButton對齊右側的文本標籤
- 25. 在右側切掉的文本字段
- 26. 右側的ListGrid選擇
- 27. 如何設置文本的右側的複選框
- 28. 如何在Android的MenuItem中顯示文本右側的圖標?
- 29. 與Android中的文本RadioButton的邊框
- 30. android-remove在右側選項菜單中刪除子菜單項的標題?