2

アプリケーションのプライマリ XML レイアウトに DrawerLayout を実装し、画面の下部を埋めるフッター (基本的には水平の [ナビゲーションっぽい] バー) を作成しました。問題は、画面の上部に継続的に表示されることです... を使用してandroid:layout_gravity="bottom"android:layout_weight="1.0"ましandroid:baselineAligned="false"。 htmlただし、レイアウトの上部にフッターを表示できないようです。

どんな提案でも大歓迎です:

XML スニペット:

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_gravity="bottom"
    android:background="@color/black"
    android:baselineAligned="false" >



    ...



        <LinearLayout
        android:id="@+id/footer"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1.0"
        android:orientation="horizontal" >
    </LinearLayout>

</android.support.v4.widget.DrawerLayout>

完全な XML ソース:

http://pastebin.com/67cHtwJ1

スクリーンショット:

ここに画像の説明を入力

4

1 に答える 1

6

layout_gravity:bottomDrawerLayoutではなく、LinearLayoutに適用する必要があります。layout_接頭辞は、子がどのように配置したいか、配置したいかなどを親に伝えることができます。親android:gravityビューに適用する必要があり、すべての子を配置するために使用されます。

于 2015-09-29T19:37:24.767 に答える