每次重新启动Android Studio时,Android活动主题都会更改

时间:2017-09-05 15:33:13

标签: android android-studio

每次重新启动Android Studio时,所有活动的主题都会更改为“Theme”或“Light”,而我希望将主题保持为“AppTheme.NoActionBar”。

我已将该行包括在内: 我的Android清单文件中的 android:theme="@style/AppTheme.NoActionBar"

1 个答案:

答案 0 :(得分:3)

确保在定义应用程序的部分中定义了哪个主题:

<application
    android:name=".ExampleApp"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme.NoActionBar">
    ...

这是您的应用程序的主题,如果您想在活动中使用特定主题,则必须设置:

android:theme ="@android:style/AppTheme.NoActionBar"/>

进入您的活动代码:

<activity
    android:theme ="@android:style/AppTheme.NoActionBar"/>
    ...