You need to make markup on the main screen of the application in the form of 6 icons.
There will be 2 rows of 3 icons, and under each of them is an inscription.
I made 2 LinearLayout
and centered them, but I just can not make labels so that they look exactly in the center of the icons on the screen of all Android devices.
Tell me, how can I do better?
Markup :
<LinearLayout android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/imageView2" android:layout_alignRight="@+id/imageView2" android:layout_alignEnd="@+id/imageView2" android:layout_marginTop="35dp" android:id="@+id/linearLayout" android:gravity="center_horizontal"> <ImageButton android:layout_width="50dp" android:layout_height="50dp" android:id="@+id/imageButton4" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" android:layout_alignParentStart="true" android:onClick="gotoNewActivityStart" android:background="@drawable/ico1" android:layout_marginRight="30dp" /> <ImageButton android:layout_width="50dp" android:layout_height="50dp" android:id="@+id/imageButton5" android:background="@drawable/ico2" android:onClick="gotoNewActivityLex" android:layout_marginRight="30dp" /> <ImageButton android:layout_width="50dp" android:layout_height="50dp" android:id="@+id/imageButton6" android:background="@drawable/map" android:onClick="gotoNewActivityMap" /> </LinearLayout>
TableLayout
with 3x4 cells -TableLayout
position the pictures and text in rows, center inside the cell withgravity
- pavlofff