3
I have the following layout:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<Button>
<TableLayout>android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:layout_gravity="center_horizontal">
(Aqui tem algumas <TableRows>)
</TableLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:orientation="vertical">
<Button>
</LinearLayout>
</LinearLayout>
You have to make sure that everything is centered vertically, from the first button to the last, keeping organized as it is. I tried putting android:layout_centerVertical="true"
but it doesn’t work. What should I do?
tries using
android:layout_centerInParent="true"
on the first level, I, after suffering a lot with the positioning of components on the screen, saw that the best way is to nesting linearlayouts and inside them the structures I need– Armando Marques Sobrinho
did not work for me, I put in the first level
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="match_parent"
 android:layout_height="match_parent"
 android:orientation="vertical"
 android:layout_centerInParent="true">
– crnmn
put your layout file in the answer so you can see what can be done
– Armando Marques Sobrinho
Thank you very much Armando, but I did it with a simple
android:gravity:"center"
, how had I not done it before? I don’t know. kk– crnmn