我是android、Kotlin的初学者, 我不知道如何删除特定 Activity 和所有 Activity 中的顶部应用栏。 我有启动画面和新 Activity 下面是我的样式代码,我已经在 styles.xml 中导入了一个 Material 设计 不知道在styles.xml中去掉top app bar的方法是什么
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
</resources>
Android list 文件
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.shanjostech.newsample">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".Main_Screen"></activity>
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
最佳答案
将主题属性添加到要在 list 文件中隐藏应用栏的 Activity
<activity
android:name="com.mvvm.Activity"
android:label="@string/app_name"
android:theme="@style/NewTheme">
</activity>
然后在 style.xml 中创建一个新主题,父主题为 Theme.AppCompat.NoActionBar
<style name="NewTheme" parent="Theme.AppCompat.NoActionBar">
</style>
关于android - 我需要删除特定 Activity 中的顶部应用栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64780949/