<Button
android:id="@+id/button1"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:text="Click Me" />
<Button
android:id="@+id/button2"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/button1"
android:text="Click me1" />
<Button
android:id="@+id/button3"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_below="@+id/button1"
android:text="Click Me2" />
<Button
android:id="@+id/button4"
android:layout_width="120dp"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/button3"
android:layout_below="@+id/button2"
android:text="Click me3" />
I tried to use this code for main activity using relative layout but I want to align them all in sync in the centre of the screen. Can anybody help me here plz?
I want to achieve an output such that it should look like:
Button1 Button2
Button3 Button4
And the whole set should be collectively in centre of the screen whatsoever is the screen size.