Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/unity3d/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android AppBar出现在不应该出现的位置';T_Android_Android Appbarlayout - Fatal编程技术网

Android AppBar出现在不应该出现的位置';T

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活动

我有一个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
活动的布局文件中没有提到
appbar
, 然而,当我从第一个调用第二个活动时,我仍然可以看到
AppBar
出现在屏幕顶部


是否有方法覆盖此行为?

问题应该在主题xml中。 尝试在“values/styles.xml”中定义“.NoActionBar”主题,例如“@style/theme.AppCompat.NoActionBar”


另一种方法是在AndroidManifest中定义活动主题

您确定没有混淆AppBar和Actionbar吗?第二个活动是否使用“.NoActionBar”主题?否则,即使没有指定操作栏,您仍然会看到一个操作栏。