私はいくつかの画像ボタンを持っていて、それぞれに対応するテキストビューがあります。それらのテキストビューを対応する画像ビューの中央に配置したいと思います。つまり、アプリドロワーに表示されるように...
!-----!
!icon !
!_____!
app name
これは私のコードです、私は使用していますRelativeLayout
<ImageButton
android:id="@+id/blog_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/logo_img"
android:layout_marginLeft="50dp"
android:layout_marginTop="51dp"
android:background="@null"
android:contentDescription="@string/blog_desc"
android:src="@drawable/blog" />
<TextView
android:id="@+id/blog_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/blog_button"
android:layout_below="@+id/blog_button"
android:layout_marginTop="8dp"
android:text="@string/blog_desc" />