linearlayout at the bottom of the screen

Asked

Viewed 85 times

1

Where I have seen for the layout or component to stay at the bottom of the screen(bottom) would have to be put in the xml that: android:Gravity="bottom" but I’m doing this because I want to make the linear layout where you find the buttons stay at the bottom and it’s not working, someone knows tell me why?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="usuario.app.web_service.interfaces.Tela2"
    android:orientation="vertical"
    android:background="#286782">

    <VideoView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/VV1"
        android:layout_weight="1"
        android:layout_gravity="top"/>

    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:layout_weight="0"
        android:gravity="bottom">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="New Text"
            android:id="@+id/txt"
            android:gravity="bottom"/>
    </LinearLayout>

    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom"
        android:layout_weight="0"
        android:gravity="bottom">

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/btnVoltar"
            android:id="@+id/button2"
            android:layout_weight="2" />

        <Button
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/btnAvanca"
            android:id="@+id/button3"
            android:layout_weight="2"
            />
    </LinearLayout>

</LinearLayout>
  • Can you explain it better? I just copied your layout and that was the result( that seems to be what you want ) : http://i.stack.Imgur.com/Ugxoz.png

  • I’ve already decided here Caique, vlw there for the help

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.