Android AppBar出现在不应该出现的位置';T
我有一个android应用程序,有两个活动Android AppBar出现在不应该出现的位置';T,android,android-appbarlayout,Android,Android Appbarlayout,我有一个android应用程序,有两个活动main和secondary main活动的XML中有以下几行: <android.support.design.widget.AppBarLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/AppTheme.AppBarOverlay"> secondary活动
main
和secondary
main
活动的XML
中有以下几行:
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
secondary
活动的布局文件中没有提到appbar
,
然而,当我从第一个调用第二个活动时,我仍然可以看到AppBar
出现在屏幕顶部
是否有方法覆盖此行为?问题应该在主题xml中。 尝试在“values/styles.xml”中定义“.NoActionBar”主题,例如“@style/theme.AppCompat.NoActionBar”
另一种方法是在AndroidManifest中定义活动主题您确定没有混淆AppBar和Actionbar吗?第二个活动是否使用“.NoActionBar”主题?否则,即使没有指定操作栏,您仍然会看到一个操作栏。