0
如何在我的屏幕底部添加一個欄,並保留視圖的其餘部分可滾動?我的根視圖是一個ScrollView,所以我假定它內的任何東西都是可滾動的,但是我不能在外面放置任何東西,除非它告訴我我有多個根標籤。滾動視圖內的穩定導航欄
如何在我的屏幕底部添加一個欄,並保留視圖的其餘部分可滾動?我的根視圖是一個ScrollView,所以我假定它內的任何東西都是可滾動的,但是我不能在外面放置任何東西,除非它告訴我我有多個根標籤。滾動視圖內的穩定導航欄
我覺得像這樣的東西應該工作。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<ScrollView
android:id="@+id/scrollview"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@id/toolbar"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize"
android:layout_alignParentBottom="true"/>
</RelativeLayout>
請查閱Toolbar瞭解更多信息。它在API級別21中發佈,並位於支持庫v7中。
你知道我該如何將工具欄附加到屏幕的底部嗎? – Brejuro
提供的佈局會將工具欄附加到滾動視圖下方的屏幕底部。 – doubleA
嗯,我得到'沒有找到類「android.view.Toolbar」'我認爲它與API級別有關你知道我會做什麼來支持這個嗎? – Brejuro