进入AndroidManifest.xml
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.New"
tools:targetApi="31">
在Android中,android:theme 是一个XML属性,用于指定应用程序、活动或视图所使用的主题。主题定义了应用程序的整体外观和感觉,包括颜色、字体、背景等方面的样式。
跳转进Theme.New,进入themes.xml
<resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. -->
<style name="Base.Theme.New" parent="Theme.Material3.DayNight.NoActionBar">
<!-- Customize your light theme here. -->
<!-- <item name="colorPrimary">@color/my_light_primary</item> -->
</style>
<style name="Theme.New" parent="Base.Theme.New" />
</resources>
可以看到使用了Theme.Material3.DayNight.NoActionBar主题,Theme.Material3.DayNight.NoActionBar 是一个预定义的 Android 主题,它是 Material Design 3 中的一部分。它的特点是适用于日间和夜间模式,并且没有顶部的默认导航栏(ActionBar)。
所以我们返回AndroidManifest.xml,把android:theme=“@style/Theme.New"改为 android:theme=”@style/Theme.Material3.DayNight"
,使用默认样式就行了