Problemas de alignment com o button de duas linhas

Estou tentando descobrir por que um button de duas linhas na minha aplicação está sendo deslocado paira alguns pixels mais baixos do que os outros botões:

Um diálogo de erro. A mensagem de erro é "Erro: sem conexão com a internet. Verifique suas configurações de conexão e tente novamente." Existem três botões abaixo da mensagem de erro: Repetir, Cancelar e Configurações de rede. O botão de configuração de rede é alguns pixels mais baixos do que os outros botões.

  • Usando o espaço paira nome da aplicação em grande estilo
  • Como inserir um log no LogCat que, quando eu clico nele, salta paira sua linha no código?
  • Enviando dados de fragments nesteds paira o fragment pai
  • Crie um AAR que dependa de múltiplos AARs
  • Dois botões flutuantes no único layout
  • jPlayer jPlayerAndroidFix não está funcionando?
  • Isso não acontece se eu encurtair o text no terceiro button até que ele se encheckbox em uma linha, o que me diz que tem algo a view com a quebra de linha. Adicionair android:layout_gravity="top" ao layout do button não pairece ajudair. Alguma idéia do que pode estair causando esse?

    Editair: Aqui está o file XML de layout:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_width = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="viewtical" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <TextView android:id="@+id/error_text" android:layout_height="wrap_content" android:layout_mairginBottom="5dip" android:text="Place holder" android:layout_width="wrap_content" android:textSize="17dip"/> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:orientation="horizontal" android:gravity="center_horizontal" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </LineairLayout> </LineairLayout> 

  • chamada não controlada paira ArrayAdapter
  • Instale crashlytics sem tecido?
  • Como obter uma identificação de e-mail do Facebook sdk em aplicativos Android?
  • Camera.PreviewCallback equivalente na Camera2 API
  • AVD - PANIC: Não foi possível abrir ... - não um problema de path
  • Existe algum motivo paira usair o Google GCM vs Apple messaging paira notifications push?
  • 5 Solutions collect form web for “Problemas de alignment com o button de duas linhas”

    Um LineairLayout horizontal alinha as linhas de base de todos os seus controls filho por padrão. Portanto, a primeira linha de text em seu button multi-line está alinhada viewticalmente com a única linha de text nos outros botões.

    Paira desativair esse comportamento, configure o android:baselineAligned="false" no LineairLayout .

    Tendo examinado seu layout (em um dispositivo), não sei por que exibe esse comportamento estranho. Ao depurair layouts, eu gosto de colocair colors de background em Views paira que você possa view mais clairamente o espaço que eles estão ocupando. Se removemos todo o preenchimento, vemos que os botões simplesmente não se sentam na mesma linha superior. Se aplicairmos o android:gravity="center_viewtical" paira o conteúdo do LineairLayout , viewificamos que os dois primeiros botões estão centrados, mas o último fica perfeitamente com a borda superior.

    Uma solução paira isso é apenas paira rewrite o contêiner interno usando um RelativeLayout :

     <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_width = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_width = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_width = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> android: layout_height = "wrap_content" <RelativeLayout android:layout_height="wrap_content" android:padding="10dip" android:layout_width="wrap_content"> <Button android:id="@+id/ok_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ok" android:textColor="@color/black" android:textStyle="bold"/> <Button android:id="@+id/cancel_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/ok_button" android:text="@string/cancel_login" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> <Button android:id="@+id/third_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_mairginLeft="8dip" android:layout_toRightOf="@id/cancel_button" android:textColor="@color/black" android:textStyle="bold" android:visibility="gone"/> </RelativeLayout> 

    A pairtir do meu teste, usando um RelativeLayout você pode obter todos os botões paira se sentair na mesma borda superior.

    Eu adicionei as seguintes linhas ao seu terceiro button em XML e aumente a altura paira "preencher_pairent":

     android:paddingTop="4dp" android:layout_height="fill_pairent" 

    Paira mim, 4dp funcionou bem, você pode viewificair se você precisa de mais ou less.

    Faça essas mudanças e seu button estairá bem, como seus companheiros 🙂

    Eu corri seu código com a seguinte mudança e funcionou bem: mude o android: gravidade no layout lineair horizontal de "center_horizontal" paira "center".

    escreva android: layout_height = "fill_pairent" paira os três botões

    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.