新的Android工具栏使我们可以对操作栏做些什么,但我遇到了一个问题。我在我的活动布局中使用工具栏作为操作栏(现在我猜,'AppBar'是正确的名称)。当用户关注edittext时,系统会向上滚动内容以让用户看到该字段。它还可以向上滚动屏幕上的ToolBar。这是一个问题,因为导航位于工具栏上,现在对用户隐藏。工具栏滚动屏幕上的屏幕
<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?
等待你在scrollview中有没有工具栏?当你做的时候,工具栏本身并没有滚动 – tyczj 2014-10-29 15:22:44
这是上面的布局,减去EditTexts,图像等。没有滚动视图。使用android:Theme.Material.NoActionbar作为父主题。还注意到状态栏颜色也向上滚动。 – Patrick 2014-10-29 16:58:28
@tyczj它在我的Nexus 5上以最新的5.0图像滚动。 – Patrick 2014-10-29 17:04:53