2016-07-07 11 views

Antwort

2

Verwenden GridLayout

<?xml version="1.0" encoding="utf-8"?> 
<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="wrap_content" 
android:rowCount="3" 
android:columnCount="3" 
android:layout_height="wrap_content"> 

<Button 
    android:text="1" 
    android:background="#00f" 
    android:layout_height="wrap_content" 
    android:layout_gravity="fill" 
    android:layout_rowSpan="2" 
    android:layout_width="wrap_content"/> 
<Button 
    android:text="2" 
    android:layout_columnSpan="2" 
    android:layout_gravity="fill" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content"/> 
<Button 
    android:text="3" 
    android:layout_gravity="fill" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content"/> 
<Button 
    android:text="4" 
    android:layout_rowSpan="2" 
    android:layout_gravity="fill" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content"/> 
<Button 
    android:text="5" 
    android:layout_gravity="fill" 
    android:layout_columnSpan="2" 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content"/> 

</GridLayout> 

Ausgabe

enter image description here