android - Relative layouts children positions -


i need adjust layout button exit on right corner of layout , image button below center of layout. should accurately there support background multiple screens. used relative layout , inside image buttons, unable set image button 2 on position. if it, whole layout vertically expanded.

<relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#00ffffff" android:orientation="vertical" tools:context="com.rabiya.menu.mainactivity" android:id="@+id/rl01" >     <relativelayout   android:id="@+id/rl02"   android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:layout_alignparentbottom="true"   android:layout_alignparentleft="true"   android:layout_alignparentstart="true"   android:layout_marginbottom="15dp"   android:background="@drawable/background3" >     <imagebutton       android:id="@+id/exit3"       android:layout_width="wrap_content"       android:layout_height="wrap_content"       android:layout_alignparentright="true"       android:layout_alignparentend="true"        android:contentdescription="@string/image"       android:layout_alignparenttop="true"       android:background="@drawable/exit"        />     <textview            android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:id="@+id/tv01"   android:background="#000"   android:layout_centerhorizontal="true"/>    <linearlayout    android:layout_width="wrap_content"   android:layout_height="wrap_content"   android:id="@+id/rl03"   android:background="#00ffffff"   android:layout_below="@+id/tv01"   android:orientation="vertical"    >           <imagebutton            android:id="@+id/button1"            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:background="@drawable/click"            android:contentdescription="@string/image"            android:paddingtop="20dip" />       <imagebutton      android:id="@+id/button2"      android:layout_width="wrap_content"      android:layout_height="wrap_content"      android:background="@drawable/click"      android:contentdescription="@string/image"       />        <imagebutton      android:id="@+id/button3"      android:layout_width="wrap_content"      android:layout_height="wrap_content"       android:background="@drawable/click"      android:contentdescription="@string/image"       />        <imagebutton      android:id="@+id/button4"      android:layout_width="wrap_content"      android:layout_height="wrap_content"       android:background="@drawable/click"      android:contentdescription="@string/image"       />     </linearlayout>    </relativelayout>   </relativelayout> 

i don't understand cleary wath yo want seems problems have , change layout framelayout http://www.tutorialspoint.com/android/android_frame_layout.htm

mayby gravity center 1 , gravite aling right buton works


Comments