Android alert alignement issue with radio button -


i new android programming. created alert box having title question , body contains answers (radio button).

1 . want reduce fort size of title (my question) 2 . align radio options below text center..

enter image description here

my dialogbox.xml

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="match_parent"     android:layout_height="wrap_content"     android:background="#800080" >      <linearlayout         android:id="@+id/namelayout"         android:layout_width="wrap_content"         android:layout_height="wrap_content"          android:layout_centerhorizontal="true">          <textview             android:layout_width="73dp"             android:layout_height="50dp"             android:gravity="center"             android:text="5am-6am" />          <textview             android:layout_width="73dp"             android:layout_height="50dp"             android:gravity="center"             android:text="6am-8am" />          <textview             android:layout_width="73dp"             android:layout_height="50dp"             android:gravity="center"             android:text="6pm-8pm" />          <textview             android:layout_width="73dp"             android:layout_height="50dp"             android:gravity="center"             android:text="8pm-11pm" />     </linearlayout>      <radiogroup         android:id="@+id/radiogroub"         android:layout_width="280dp"         android:layout_height="wrap_content"         android:layout_below="@+id/namelayout"         android:gravity="center"         android:orientation="horizontal"          android:layout_centerhorizontal="true">          <radiobutton             android:id="@+id/sms1"             android:layout_width="60dp"             android:layout_height="50dp" />          <radiobutton             android:id="@+id/sms2"             android:layout_width="60dp"             android:layout_height="50dp" />          <radiobutton             android:id="@+id/sms3"             android:layout_width="60dp"             android:layout_height="50dp" />          <radiobutton             android:id="@+id/sms4"             android:layout_width="60dp"             android:layout_height="50dp" />     </radiogroup>      <linearlayout         android:id="@+id/btnlayout"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:layout_below="@+id/radiogroub"         android:gravity="center"         android:orientation="horizontal" >          <button             android:id="@+id/sendbtn"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centerhorizontal="true"             android:text="send" />          <button             android:id="@+id/closebtn"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:layout_centerhorizontal="true"             android:text="close" />     </linearlayout>  </relativelayout> 

use layout:

<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:background="#800080"     android:orientation="vertical" >      <linearlayout         android:id="@+id/namelayout"         android:layout_width="match_parent"         android:layout_height="50dp"         android:layout_weight="0"         android:orientation="horizontal"         android:visibility="visible" >          <textview             android:layout_width="match_parent"             android:layout_height="50dp"             android:layout_weight="1"             android:gravity="center"             android:text="5am-6am" />          <textview             android:layout_width="match_parent"             android:layout_height="50dp"             android:layout_weight="1"             android:gravity="center"             android:text="6am-8am" />          <textview             android:layout_width="match_parent"             android:layout_height="50dp"             android:layout_weight="1"             android:gravity="center"             android:text="6pm-8pm" />          <textview             android:layout_width="match_parent"             android:layout_height="50dp"             android:layout_weight="1"             android:gravity="center"             android:text="8pm-11pm" />     </linearlayout>      <radiogroup         android:id="@+id/radiogroub"         android:layout_width="match_parent"         android:layout_height="50dp"         android:orientation="horizontal" >          <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:gravity="center" >              <radiobutton                 android:id="@+id/sms1"                 android:layout_width="wrap_content"                 android:layout_height="match_parent" />         </linearlayout>          <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:gravity="center" >              <radiobutton                 android:id="@+id/sms2"                 android:layout_width="wrap_content"                 android:layout_height="match_parent" />         </linearlayout>          <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:gravity="center" >              <radiobutton                 android:id="@+id/sms3"                 android:layout_width="wrap_content"                 android:layout_height="match_parent" />         </linearlayout>          <linearlayout             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:gravity="center" >              <radiobutton                 android:id="@+id/sms4"                 android:layout_width="wrap_content"                 android:layout_height="match_parent" />         </linearlayout>     </radiogroup>      <linearlayout         android:id="@+id/btnlayout"         android:layout_width="match_parent"         android:layout_height="50dp"         android:layout_weight="0"         android:orientation="horizontal" >          <button             android:id="@+id/sendbtn"             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:text="send" />          <button             android:id="@+id/closebtn"             android:layout_width="match_parent"             android:layout_height="match_parent"             android:layout_weight="1"             android:text="close" />     </linearlayout>  </linearlayout> 

Comments