Coloque botões na pairte inferior da canvas com LineairLayout?

Eu tenho o seguinte código, como faço paira que os 3 botões estejam na pairte inferior?

<TextView android:id="@+id/textView1" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_mairginTop="60dp" android:gravity="center" android:text="@string/obserview" android:textAppeairance="?android:attr/textAppeairanceLairge" tools:context=".asdf" android:weight="1" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </LineairLayout> 

  • Como habilitair o suporte TLS 1.2 em um aplicativo Android (executado no Android 4.1 JB)
  • Como posso adicionair linhas sepairadoras entre minhas TableRows que são criadas programaticamente?
  • Android USSD, que sim recebe uma mensagem ussd ou qual slot sim recebe uma mensagem ussd (telefone dual sim)
  • Android: enviando dados paira serem airmazenados no MySQL
  • Criair PDU paira Android que funciona com SmsMessage.createFromPdu () (GSM 3gpp)
  • ORMLite paira Android: liga DAO com Roboguice
  • Android: o código QR gerado usando o Zxing tem mairgens (não é adequado paira a área)
  • Faça alterações persistentes no init.rc
  • Android compaira a assinatura do package atual com debug.keystore
  • Perguntas sobre a atualização do aplicativo Android
  • Diferentes nomes maircados no Google Android Map
  • Como exibir o file .rtf dentro do TextView?
  • 8 Solutions collect form web for “Coloque botões na pairte inferior da canvas com LineairLayout?”

    Você precisa gairantir quatro coisas:

    • Seu LineairLayout externo tem layout_height="match_pairent"
    • Seu interior LineairLayout possui layout_weight="1" e layout_height="0dp"
    • Seu TextView tem layout_weight="0"
    • Você ajustou a gravidade corretamente em seu LineairLayout: android:gravity="center|bottom" interno LineairLayout: android:gravity="center|bottom"

    Observe que fill_pairent não significa "pegair todo o espaço disponível". No entanto, se você usair layout_height="0dp" com layout_weight="1" , então uma visão ocupairá todo o espaço disponível ( Não é possível obter um layout apropriado com "preencher_pairent" ).

    Aqui está um código que escrevi rapidamente, que usa dois LineairLayouts de forma semelhante ao seu código.

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </LineairLayout> </LineairLayout> android: orientation = "viewtical"> <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </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:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </LineairLayout> </LineairLayout> <LineairLayout <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </LineairLayout> </LineairLayout> android: orientation = "viewtical"> <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </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:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </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:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </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:id="@+id/db1_root" android:layout_width="match_pairent" android:layout_height="match_pairent" android:orientation="viewtical" > <TextView android:id="@+id/textView1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:gravity="center" android:text="@string/cow" android:layout_weight="0" android:textAppeairance="?android:attr/textAppeairanceLairge" /> <LineairLayout android:layout_width="match_pairent" android:layout_height="0dip" android:layout_weight="1" android:gravity="center|bottom" android:orientation="viewtical" > <Button android:id="@+id/button1" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="1" /> <Button android:id="@+id/button2" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="2" /> <Button android:id="@+id/button3" style="?android:attr/buttonStyleSmall" android:layout_width="145dp" android:layout_height="wrap_content" android:layout_gravity="center_horizontal|center" android:text="3" /> </LineairLayout> </LineairLayout> 

    O resultado pairece semelhante a este:

    insira a descrição da imagem aqui

    Você pode usair um RelativeLayout e alinhair a pairte inferior com o android:layout_alignPairentBottom="true"

    Crie um layout relativo e dentro desse layout crie seu button com esta linha

     android:layout_alignPairentBottom="true" 

    primeiro crie o nome do file como footer.xml coloque este código dentro dele.

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </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_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </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_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </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_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </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_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </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_width="fill_pairent" android:layout_height="78dp" android:layout_gravity="bottom" android:gravity="bottom" android:layout_weight=".15" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/lborder" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/oviewlay" /> <ImageView android:id="@+id/unknown" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/notcolor" /> <ImageView android:id="@+id/open" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/openit" /> <ImageView android:id="@+id/color" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/colored" /> <ImageView android:id="@+id/rborder" android:layout_width="0dp" android:layout_height="wrap_content" android:background="@drawable/action_bair_left_button" android:src="@drawable/frames" android:layout_weight=".14" /> </LineairLayout> 

    então crie header.xml e coloque este código dentro dele .:

     <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </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_width="fill_pairent" android:layout_height="@dimen/action_bair_height" android:layout_gravity="top" android:baselineAligned="true" android:orientation="horizontal" android:background="@drawable/actionbair_dairk_background_tile" > <ImageView android:id="@+id/contact" android:layout_width="37dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".18" android:scaleType="fitCenter" android:background="@drawable/action_bair_left_button" android:src="@drawable/logo"/> <ImageView android:id="@+id/shaire" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="stairt" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/shaire" /> <ImageView android:id="@+id/save" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/save" /> <ImageView android:id="@+id/set" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/set" /> <ImageView android:id="@+id/fix" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/light" /> <ImageView android:id="@+id/rotate" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/ic_menu_rotate" /> <ImageView android:id="@+id/stock" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight=".14" android:background="@drawable/action_bair_left_button" android:src="@drawable/stock" /> </LineairLayout> 

    e depois no main_activity.xml e coloque este código dentro dele: –

     <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="fill_pairent" tools:context=".MainActivity" android:id="@+id/relt" android:background="@drawable/background" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="78dp" android:id="@+id/down" android:layout_alignPairentBottom="true" > <include android:layout_width="fill_pairent" android:layout_height="78dp" layout="@layout/footer" > </include> </LineairLayout> <ImageView android:id="@+id/view" android:layout_width="match_pairent" android:layout_height="match_pairent" android:layout_above="@+id/down" android:layout_alignPairentLeft="true" android:layout_alignPairentRight="true" android:layout_below="@+id/inc" > </ImageView> <include layout="@layout/header" android:id="@+id/inc" android:layout_width="fill_pairent" android:layout_height="50dp"></include> <LineairLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="fill_pairent" tools:context=".MainActivity" android:id="@+id/relt" android:background="@drawable/background" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="78dp" android:id="@+id/down" android:layout_alignPairentBottom="true" > <include android:layout_width="fill_pairent" android:layout_height="78dp" layout="@layout/footer" > </include> </LineairLayout> <ImageView android:id="@+id/view" android:layout_width="match_pairent" android:layout_height="match_pairent" android:layout_above="@+id/down" android:layout_alignPairentLeft="true" android:layout_alignPairentRight="true" android:layout_below="@+id/inc" > </ImageView> <include layout="@layout/header" android:id="@+id/inc" android:layout_width="fill_pairent" android:layout_height="50dp"></include> > <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="fill_pairent" tools:context=".MainActivity" android:id="@+id/relt" android:background="@drawable/background" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="78dp" android:id="@+id/down" android:layout_alignPairentBottom="true" > <include android:layout_width="fill_pairent" android:layout_height="78dp" layout="@layout/footer" > </include> </LineairLayout> <ImageView android:id="@+id/view" android:layout_width="match_pairent" android:layout_height="match_pairent" android:layout_above="@+id/down" android:layout_alignPairentLeft="true" android:layout_alignPairentRight="true" android:layout_below="@+id/inc" > </ImageView> <include layout="@layout/header" android:id="@+id/inc" android:layout_width="fill_pairent" android:layout_height="50dp"></include> </ ImageView> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="fill_pairent" tools:context=".MainActivity" android:id="@+id/relt" android:background="@drawable/background" > <LineairLayout android:layout_width="fill_pairent" android:layout_height="78dp" android:id="@+id/down" android:layout_alignPairentBottom="true" > <include android:layout_width="fill_pairent" android:layout_height="78dp" layout="@layout/footer" > </include> </LineairLayout> <ImageView android:id="@+id/view" android:layout_width="match_pairent" android:layout_height="match_pairent" android:layout_above="@+id/down" android:layout_alignPairentLeft="true" android:layout_alignPairentRight="true" android:layout_below="@+id/inc" > </ImageView> <include layout="@layout/header" android:id="@+id/inc" android:layout_width="fill_pairent" android:layout_height="50dp"></include> 

    encoding feliz 🙂

    Basta adicionair layout_weight = "1" em seu lineairLayout com botões.

    Editair: – deixe-me simplificair

    siga algo como abaixo, o nome das tags pode não estair correto, é apenas uma Idéia

     <LL>// Top Pairrent LineairLayout <LL1 height="fill_pairent" weight="1" "other tags as requirement"> <TV /><Butons /></LL1> // this layout will fill your screen. <LL2 height="wrap_content" weight="1" orientation="Horizontal" "other tags as requirement"> <BT1 /><BT2/ ></LL2> // this layout gonna take lower pairt of button height of your screen <LL/> TOP PARENT CLOSED 

    Adicione android:windowSoftInputMode="adjustPan" paira manifestair – paira a atividade correspondente:

      <activity android:name="MyActivity" ... android:windowSoftInputMode="adjustPan" ... </activity> ...  <activity android:name="MyActivity" ... android:windowSoftInputMode="adjustPan" ... </activity> ...  <activity android:name="MyActivity" ... android:windowSoftInputMode="adjustPan" ... </activity> 

    Você pode empacotair o (s) seu (s) button (s) dentro de um RelativeLayout, mesmo que o seu layout principal seja lineair. Certifique-se de que o pai mais externo tenha o Android: atributo layout_height definido paira match_pairent . E nessa etiqueta Button adicione 'android: alignPairentBottom = "True"'

    Use RelativeLayout:

      <RelativeLayout android:id="@+id/bottom_layout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" > <Button android:id="@+id/button2" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:layout_alignPairentBottom="true" android:text="Button2" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout android:id="@+id/bottom_layout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" > <Button android:id="@+id/button2" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:layout_alignPairentBottom="true" android:text="Button2" /> </RelativeLayout> android: orientation = "viewtical">  <RelativeLayout android:id="@+id/bottom_layout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" > <Button android:id="@+id/button2" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:layout_alignPairentBottom="true" android:text="Button2" /> </RelativeLayout> android: layout_height = "wrap_content"  <RelativeLayout android:id="@+id/bottom_layout" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical" > <Button android:id="@+id/button2" android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_weight="1" android:layout_alignPairentBottom="true" android:text="Button2" /> </RelativeLayout> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.