android - Can a radiogroup show a heading/title? -
I have set up a radiogram with three radio buttons on my app, but I want to text it from the upper part as if It does the checkbox and I can refer to the strings.xml file like this
     Because when I run the app, three radio buttons appear without any text or an easy way?   
 
  The old question is, but maybe my answer will help someone.  
 One way to add headers to all buttons is to use only  TextView  inside  RadioGroup .   And of course, you can set the text for each radio button. You should use the  android: text  property to set the text for each button below In the example of the wire used as usual, but you should remove your strings in the better strings.xml   Here is an example:  
  & lt; RadioGroup Android: id = "@ + Id / set_radiogroup" android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: orientation = "vertical" & gt; & Lt; TextView Android: id = "@ + id / header" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "Choose one of three types:" /> & Lt; RadioButton Android: id = "@ + id / onse_set" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "type one" /> & Lt; RadioButton Android: id = "@ + id / two_sets" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "type two" /> & Lt; RadioButton Android: id = "@ + id / three_sets" Android: layout_width = "wrap_content" android: layout_height = "wrap_content" android: text = "type three" /> & Lt; / RadioGroup & gt;    
 
 
Comments
Post a Comment