0
This is the layout I currently have:
And this is the code:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingBottom="@dimen/activity_vertical_margin"
tools:context="br.com.teste.MainActivity"
android:background="#d6d7d7">
<android.support.v7.widget.Toolbar
android:id="@+id/menu_principal"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimary"
android:elevation="4dp"
android:theme="@style/ThemeOverlay.AppCompat.ActionBar"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
</android.support.v7.widget.Toolbar>
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/menu_principal">
<TableLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/menu_principal"
android:layout_centerHorizontal="true"
android:layout_margin="0dp"
android:stretchColumns="2">
<TableRow
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:layout_weight="1"
android:layout_margin="0dp">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnDescontos"
android:src="@drawable/descontos"
android:layout_weight="1"
android:layout_span="1"/>
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/btnEventos"
android:src="@drawable/eventos"
android:layout_weight="1"
android:layout_span="1"/>
</TableRow>
<TableRow
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="0dp"
android:layout_weight="1"
android:layout_margin="0dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnGastronomia"
android:src="@drawable/gastronomia"
android:layout_weight="1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnEsportes"
android:src="@drawable/esportes"
android:layout_weight="1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnEmpregos"
android:src="@drawable/empregos"
android:layout_weight="1" />
</TableRow>
<TableRow
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="0dp"
android:layout_weight="1"
android:layout_margin="0dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnServicos"
android:src="@drawable/servicos"
android:layout_weight="1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnBemestar"
android:src="@drawable/bemestar"
android:layout_weight="1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/btnCultura"
android:src="@drawable/cutura"
android:layout_weight="1" />
</TableRow>
</TableLayout>
</LinearLayout>
</RelativeLayout>
And what I wish for is this:
What am I missing? Where can I get something that gives me a "north" to solve this?
I think Gridview would be better to arrive at your result.
– Leonardo Dias