关于Theme.AppCompat.DayNight如何自定义主题

values/styles.xml

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
    <!-- Customize your theme here. -->
    <item name="android:fitsSystemWindows">true</item>
</style>

<style name="AppTheme.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="windowNoTitle">true</item>
    <item name="android:fitsSystemWindows">true</item>
</style>


<style name="AppTheme.AppBarOverlay" parent="ThemeOverlay.AppCompat.Dark.ActionBar" />

<style name="AppTheme.PopupOverlay" parent="ThemeOverlay.AppCompat.Light"/>

AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
package="com.example.mingnote">

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_chaozhuo_147456"
    android:label="铭记"
    android:supportsRtl="true"
    android:theme="@style/AppTheme">

    <activity
        android:name=".MainActivity"
        android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>

    <activity android:name=".NoteEdit"
              android:label="记事"
              android:theme="@style/Theme.AppCompat.DayNight.NoActionBar">
    </activity>

    <meta-data
        android:name="com.google.android.gms.version"
        android:value="@integer/google_play_services_version" />
</application>

现在我的界面主题是自己改的,用Daynight切换夜间主题后很难看。在网上找了自定义DayNight主题的方法,在values中自定义theme.xml,在values-night中自定义theme.xml,但没效果。如何解决?

请用EDIT打开那个文件,看是否其中有非ASCII的字符(分号后的除外),很多时候是将分号写成了中文下的分号了,改成英文下的分号就可以了,再看看程序。
一般这是声明指针类型的变量,使用完后没有关闭,或者有死循环什么的.原因很多,但仔细review一下你自己的source,应该能发现里面的逻辑问题.