Note that there are some explanatory texts on larger screens.

plurals
  1. PORadiobutton with text above button
    text
    copied!<p>I am new to android and I need to add radio buttons on my activity, but i need to place the text on the to of the bullet button.</p> <p>Any help please. I found the following, though I dont understand what the @drawable/main_selector and @style/TabStyle. </p> <p><a href="https://stackoverflow.com/questions/10106726/radiobutton-with-text-on-top">Radiobutton with text on top</a></p> <p>Can anyone give me a 101 guide.</p> <p><strong>UPDATE</strong></p> <p>I used the following according to some suggestion but didnt work:</p> <pre><code>&lt;RadioGroup xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" &gt; &lt;RadioButton android:text="something that is on top" android:id="@+id/toggle_tab_left" android:button="?android:attr/listChoiceIndicatorSingle" style="@null"/&gt; &lt;RadioButton android:button="?android:attr/listChoiceIndicatorSingle" android:text="something that is on top" android:id="@+id/toggle_tab_right" style="@null"/&gt; &lt;/RadioGroup&gt; </code></pre> <p><strong>UPDATE 2</strong></p> <p>I got my solution from Warpzit, but befor i mark the question as answered, can someone help me on the alignment issue below. I will have 5 radio buttons in a row where some of them will have longer text split in 2 lines. when the text fit on the screen, because of landscape, or on tablets then all text should be in one line:</p> <p><img src="https://i.stack.imgur.com/ae9un.png" alt="enter image description here"></p> <p><strong>UPDATE 3</strong></p> <p>... depending on the screen size the text can split into different number of lines. It wont be always standard</p> <p><img src="https://i.stack.imgur.com/ChUcD.png" alt="enter image description here"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload