Tecnologia do Blogger.
RSS

Re: [androidbrasil-dev] Mesmo XML - Layouts diferentes - API 10 e API 17

Coloque "android:gravity=center" para o seu LinearLayout.


Em 8 de julho de 2013 10:40, Daniel Lima <danielhenriquelima@gmail.com> escreveu:
Alguém poderia me explicar o que pode ser este comportamento abaixo? 

O xml abaixo, gera dois layouts distintos dependendo da API. Na API 17, exibe normalmente, ou seja, os campos de login centralizados. Na API10, o mesmo xml exibe os campos no canto superior esquerdo. 









<?xml version="1.0" encoding="utf-8"?>


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


    android:layout_width="match_parent"


    android:layout_height="match_parent"


    android:background="#005500">


   


    <LinearLayout


        android:layout_width="match_parent"


        android:layout_height="wrap_content"


        android:layout_marginLeft="15dip"


        android:layout_marginRight="15dip"


        android:layout_marginTop="200dip"


        android:orientation="vertical" >


       


        <EditText


          android:id="@+id/et_nome_login"


          android:layout_width="match_parent"


          android:layout_height="40dip"


          android:paddingRight="15dip"


          android:paddingLeft="15dip"


          android:inputType="text"


          android:nextFocusDown="@+id/et_senha_login"


          android:background="@drawable/bg_login_name"/>


       


        <EditText


          android:id="@+id/et_senha_login"


          android:layout_width="match_parent"


          android:layout_height="40dip"


          android:paddingRight="15dip"


          android:paddingLeft="15dip"


          android:inputType="textPassword"


          android:background="@drawable/bg_login_senha"/>


       


        <ImageButton


            android:id="@+id/ib_login"


            android:layout_width="match_parent"


            android:layout_height="50dip"


            android:layout_marginTop="20dip"


            android:background="@drawable/btn_entrar"/>


       


    </LinearLayout>


   


   


    <FrameLayout


                android:id="@+id/progress_login"


                android:layout_width="match_parent"


                android:layout_height="match_parent"


                android:background="#AA000000"


                android:clickable="true"


                android:focusable="true"


                android:focusableInTouchMode="true"


                android:visibility="gone" >


       


                <ProgressBar


                    android:layout_width="50dp"


                    android:layout_height="50dp"


                    android:focusable="true"


                    android:focusableInTouchMode="true"


                    android:layout_gravity="center" />


    </FrameLayout>




</FrameLayout>


Vejam as imagens com os comportamentos registrados.



Desde já agradeço muitíssimo!!!!!!

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Analista-Programador

--
You received this message because you are subscribed to the Google Groups "Android Brasil - Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to androidbrasil-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

0 comentários:

Postar um comentário