Ajustar Porcentaje Layout

350 views
Skip to first unread message

Sergio Tizon

unread,
Mar 28, 2014, 3:58:13 AM3/28/14
to desarrollad...@googlegroups.com
Hola de nuevo, tengo cierto poblemilla a la hora de ajustar mis Layout. He podido controlar los Layout Horizontales, pero a la hora de intentar controlar los verticales no me cuadra.

Les enseño mi codigo:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" 
        android:orientation="horizontal"
        android:layout_weight="1"                    ---------> Aquí tengo un numero para el porcentaje de la página 
        android:gravity="center_vertical">
        <RelativeLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:gravity="center_horizontal"
            android:layout_weight="3">
    <Button
       android:id="@+id/button1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:layout_alignParentLeft="true"
       android:layout_alignParentRight="true"
       android:text="BotonSuperior" />
    </RelativeLayout>
<RelativeLayout 
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1">
    <TextView
       android:id="@+id/textView1"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:textAlignment="center"
       android:layout_alignParentLeft="true"
       android:layout_alignParentRight="true"
       android:text="TextoSuperior" />
    </RelativeLayout>
    </LinearLayout>
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent" 
        android:orientation="horizontal"
        android:layout_weight="2">           --------------------> Aquí tengo el otro número para el porcentaje
<RelativeLayout 
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"> 
    <Button
            android:id="@+id/btn1"
            android:layout_width="match_parent"
            android:layout_centerInParent="true"
            android:layout_height="40dp"
            android:textSize="11dp"
            android:gravity="center"
            android:text="BotonInferior" />
   </RelativeLayout>
</LinearLayout>
</LinearLayout>

Deberia mostrarme el Layout inferior el doble de grande que el segundo, o al menos asi funciona de forma horizontal, alguno podría decirme que hago mal?

Gracias por atenderme!

Un Saludo! 

¡Sergio!

Gabriel Pozo

unread,
Mar 28, 2014, 8:57:01 AM3/28/14
to desarrollad...@googlegroups.com
Creo que solo con dar vuelta estos valores funcionaría:


android:layout_width="0dp"
android:layout_height="match_parent"

--
Para participar es necesario que leas detenidamente las normas del grupo: http://goo.gl/8h8ez2
---
Has recibido este mensaje porque estás suscrito al grupo "desarrolladores-android" de Grupos de Google.
Para anular la suscripción a este grupo y dejar de recibir sus mensajes, envía un correo electrónico a desarrolladores-a...@googlegroups.com.
Para publicar en este grupo, envía un correo electrónico a desarrollad...@googlegroups.com.
Visita este grupo en http://groups.google.com/group/desarrolladores-android.
Para ver esta conversación en el sitio web, visita https://groups.google.com/d/msgid/desarrolladores-android/a2e63fd1-c18d-4c83-aa77-b2acf317cb08%40googlegroups.com.
Para acceder a más opciones, visita https://groups.google.com/d/optout.



--
Saludos, Gabriel

http://aprendiendodeandroidymas.com/

Sergio Tizon

unread,
Apr 1, 2014, 3:57:35 AM4/1/14
to desarrollad...@googlegroups.com
Gracias. ^_^
Reply all
Reply to author
Forward
0 new messages