android - Relative Layout align an item below and to the middle of another item -


i using relative layout , want align textview below , in middle of button shown in attached image. have can bottom using below, cant figure out how align horizontal centers.

enter image description here

easiest way put image , textview relative layout

 <relativelayout      android:layout_width="wrap_content"     android:layout_height="wrap_content"      >      <imageview         android:id="@+id/imageview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_centerhorizontal="true"         android:src="@drawable/ic_launcher" />      <textview         android:id="@+id/textview1"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         android:layout_below="@+id/imageview1"         android:layout_centerhorizontal="true"         android:text="textview" />   </relativelayout> 

edit

to in single layout add android:drawabletop textview

<textview     android:id="@+id/textview1"     android:layout_width="wrap_content"     android:layout_height="wrap_content"     android:text="textview"      android:drawabletop="@drawable/ic_launcher"/> 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

c++ - End of file on pipe magic during open -