所以,我有一个带有导航视图的活动。通过单击其项目,我更改了活动中的片段。所有片段都有相同的工具栏。但是有这个工具栏和 TabLayout。我想知道在这样的活动上声明工具栏更好
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include layout="@layout/toolbar" />
<FrameLayout
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/toolbar" />
</RelativeLayout>
或在每个片段中声明它。
第一种方法的缺点是默认工具栏阴影。当我在片段中添加选项卡时,阴影看起来像
当我尝试 2 解决方案时。我所有的工具栏都带有后退图标而不是抽屉动画徽标。
谢谢。