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.
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
Post a Comment