2016-04-07 16 views
3

Wie kann ich passe diese Textansicht, so dass es nicht das 2 Bild Buttons.I es hat auf sie möchte nicht verformt 2. Dies ist, wie sie erscheinen jetzt:Android Layout-Textview

Layout now

This is how the buttons should look like:

Hier ist meine xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:weightSum="2" 
android:orientation="horizontal"> 



<ImageButton 
    android:layout_width="0dp" 
    android:layout_height="400dp" 
    android:layout_weight="1" 
    android:id="@+id/botoAbdominals" 
    android:background="@drawable/abdominals" 
    android:contentDescription="ImatgeAbdominals" 
    android:layout_marginTop="50dp" 
    android:layout_marginRight="10dp" 
    android:layout_marginLeft="10dp" 
    android:layout_gravity="center" 
    /> 


<ImageButton 
    android:layout_width="0dp" 
    android:layout_height="400dp" 
    android:layout_weight="1" 
    android:id="@+id/botoFlexio" 
    android:layout_gravity="center" 
    android:layout_marginTop="50dp" 
    android:layout_marginLeft="10dp" 
    android:layout_marginRight="10dp" 
    android:background="@drawable/flexio" 
    android:contentDescription="ImatgeFlexio" 
    /> 
<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Escull la rutina desitjada" /> 

+0

setzen die Textview außerhalb Ihres Linearlayout – MojioMS

Antwort

0

es so tun, mit diesem Layout Anordnung:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
android:orientation="vertical"> 

    <TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Escull la rutina desitjada" /> 

    <LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:weightSum="2" 
    android:orientation="horizontal"> 

     <ImageButton 
     android:layout_width="0dp" 
     android:layout_height="400dp" 
     android:layout_weight="1" 
     android:id="@+id/botoAbdominals" 
     android:background="@drawable/abdominals" 
     android:contentDescription="ImatgeAbdominals" 
     android:layout_marginTop="50dp" 
     android:layout_marginRight="10dp" 
     android:layout_marginLeft="10dp" 
     android:layout_gravity="center"/> 


     <ImageButton 
     android:layout_width="0dp" 
     android:layout_height="400dp" 
     android:layout_weight="1" 
     android:id="@+id/botoFlexio" 
     android:layout_gravity="center" 
     android:layout_marginTop="50dp" 
     android:layout_marginLeft="10dp" 
     android:layout_marginRight="10dp" 
     android:background="@drawable/flexio" 
     android:contentDescription="ImatgeFlexio"/> 

    </LinearLayout> 


</LinearLayout> 
2

setzen Sie eine weitere LinearLayout um, das ist vertikale Ausrichtung. Mit der Textansicht und Linearlayout als Kinder dazu.

Die folgende Hierarchie.

> LinearLayout (vertical) 
    > TextView 
    > LinearLayout (horizontal) // [Like your current one] 
    > ImageButton 
    > ImageButton 
+1

Dank! Funktioniert perfekt!!! –

+0

@AlexiaWhite Froh, es zu hören. Und das hast du selbst geschafft, ohne dass ich den vollen Code gepostet habe :) – Doomsknight

Verwandte Themen