If you want to use the radiogroup function, but encounter some seemingly simple problems that cannot be solved: The system icons are too big to be replaced, and you can find a solution on the Internet. As mentioned in some places, because images are used, they cannot be reduced, so we have to customize them. Refer to 1 for Reference 2.
Then, find the icon and search for files containing radio in the SDK folder. If there are many files, select a suitable one.
This is the radiobutton. xml file under Res/drawable.
<Selector xmlns: Android = "http://schemas.android.com/apk/res/android">
<Item
Android: state_enabled = "true"
Android: state_checked = "true"
Android: drawable = "@ drawable/check"/>
<Item
Android: state_enabled = "true"
Android: state_checked = "false"
Android: drawable = "@ drawable/checknull"/>
</Selector>
This is the definition of radiogroup. Note:
1. The radiogroup direction is horizontal. Android: Orientation = "horizontal ".
2. The button style is Android: button = "@ drawable/radiobutton ". It took a lot of effort to find this property.
<Radiogroup Android: Id = "@ + ID/radiogroup1" Android: paddingtop = "30px" Android: paddingleft = "15px" Android: Orientation = "horizontal" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content">
<Radiobutton Android: text = "today" Android: layout_width = "wrap_content" Android: textsize = "14px" Android: checked = "true" Android: layout_height = "wrap_content" Android: editable = "false" Android: Id = "@ + ID/radio0" Android: button = "@ drawable/radiobutton" Android: paddingleft = "30px" Android: layout_marginright = "2px" Android: textcolor = "#000"> </radiobutton>
<Radiobutton Android: text = "yesterday" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: Id = "@ + ID/radio1" Android: textsize = "14px" Android: button = "@ drawable/radiobutton" Android: paddingleft = "30px" Android: layout_marginright = "2px" Android: textcolor = "#000"> </radiobutton>
<Radiobutton Android: text = "the day before yesterday" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: Id = "@ + ID/Radio2" Android: textsize = "14px" Android: button = "@ drawable/radiobutton" Android: paddingleft = "30px" Android: layout_marginright = "2px" Android: textcolor = "#000"> </radiobutton>
</Radiogroup>