layout_alignParentBottom в линейном макете - PullRequest
0 голосов
/ 07 декабря 2011

Может ли кто-нибудь помочь мне.Мне нужна кнопка внизу экрана.Для относительного макета я могу использовать

android: layout_alignParentBottom = "true"

Но что использовать, если я использую линейный макет.Пожалуйста, помогите

Ответы [ 2 ]

1 голос
/ 07 декабря 2011

вы можете попробовать что-то вроде этого

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <LinearLayout
     android:orientation="vertical"
     android:layout_width="fill_parent"
     android:layout_height="0dp"
     android:layout_weight="1.0">
    </LinearLayout>
    <Button
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Button">
    </Button>
</LinearLayout>
0 голосов
/ 07 августа 2012
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical" 
    android:gravity="bottom">

    <Button
        android:id="@+id/button1"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Button"/>

    </LinearLayout>
Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...