-1
I want to make a simple menu. But it gets all crooked Why do I do? Someone gives me tips? I’m new to android.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#FFFFFF"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="projeto.ba.gr.noamobile.MenuActivity"
tools:showIn="@layout/app_bar_menu"
android:orientation="vertical">
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="50dp"
android:layout_weight="50">
<Button
android:id="@+id/btnAlerta"
android:layout_marginTop="50dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TESTE"
android:drawableTop="@drawable/aviso"
android:background="#FFFFFF"
android:layout_marginLeft="80dp" />
<Button
android:layout_marginRight="50dp"
android:id="@+id/btnNoaCidadao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TESTE"
android:drawableTop="@drawable/aviso"
android:background="#FFFFFF"
android:layout_marginTop="50dp"
/>
</LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_weight="50"
android:layout_gravity="center_horizontal"
>
<Button
android:id="@+id/btnOperacao"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TESTE"
android:drawableTop="@drawable/aviso"
android:background="#FFFFFF"
android:layout_marginLeft="80dp"/>
<Button
android:id="@+id/btnMul"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="TESTE"
android:drawableTop="@drawable/aviso"
android:background="#FFFFFF"/>
</LinearLayout>
</LinearLayout>
Add a photo of what you’re trying to build, or a better description, "a menu" is very broad. It would be nice a photo of how your project is currently, to understand what is "crooked"
– leofontes
Suddenly Linearlayout is not what you need, try others like Relative or Frame
– GabrielLocalhost