新的 Android 工具栏为我们提供了一些使用操作栏的灵活性,但我遇到了一个问题。我在我的活动布局中使用工具栏作为操作栏(我猜现在“AppBar”是正确的名称)。当用户关注编辑文本时,系统会向上滚动内容以让用户看到该字段。它还向上和离开屏幕滚动工具栏。这是一个问题,因为导航位于工具栏上,现在对用户隐藏。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?android:attr/actionBarSize">
</Toolbar>
</LinearLayout>
我们如何才能保持 ToolBar 就位?