Android Studio不能应用我的设计更改

我试图通过删除操作栏或更改标题来更改某些活动的主题。 起初,我正在使用设计选项卡中的AppTheme选项。 但是,在网上搜索后,我知道我做的是错误的方式,所以我进入AndroidManifest文件手动进行更改。 不幸的是,它也不工作。 这是我的清单文件的代码:

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.wonderheart"> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <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=".MainActivity" android:label="Sign Up"/> <activity android:name=".Login" android:label="Log In"/> <activity android:name=".drawable.welcome"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".UserProfile" android:theme="@style/AppTheme.NoActionBar"/> <activity android:name=".HomePage" > </activity> </application> </manifest> 

以下是我尝试更改的一些活动: 成功更改 操作栏标题操作栏标题未更改

我正在使用Android Studio 3.0 Preview和Kotlin。 我希望你能帮上忙,因为如果不解决这个设计问题,我就无法继续工作。

你可以解决问题的两种方式。 1.为所有活动使用通用的主题,并在onCreate方法中使用隐藏和显示操作栏的代码

  // Set up the toolbar val toolbar = findViewById(R.id.toolbar) as Toolbar setSupportActionBar(toolbar) var actionBar = supportActionBar //For hiding android actionbar actionBar.hide(); //For showing android actionbar //actionBar.show(); 
  1. 在下面的示例中,您不希望显示操作栏的活动使用自定义样式我为应用程序级别执行了操作,但您可以将其用于任何其他活动

style.xml

 <resources> <style name = "AppTheme" parent = "android:Theme.Holo.Light.DarkActionBar"> <!-- Customize your theme here. --> </style> <style name = "NoActionBar" parent = "@android:style/Theme.Holo.Light"> <item name = "android:windowActionBar">false</item> <item name = "android:windowNoTitle">true</item> </style> </resources> 

AndroidManifest.xml中

 <application android:allowBackup = "true" android:icon = "@drawable/ic_launcher" android:label = "@string/app_name" android:theme = "@style/NoActionBar" <!--This is the important line--> > <activity