Android - Aktivitätsstartseite / Aufwärtspfeil hat zusätzliche Auffüllung / Rand mit SDK 24

Ich habe gerade meine App von SDK 23 auf SDK 24 aktualisiert.

Es ist ein Problem bei meinen Aktivitäten aufgetreten, bei denen der Aufwärts- / Ausgangspfeil angezeigt wurde (d. H.getSupportActionBar().setDisplayHomeAsUpEnabled(true)) dadurch gibt es jetzt zusätzlichen (unerwünschten) Platz zwischen dem Aufwärtspfeil und dem Aktivitätstitel.

Bei Aktivitäten ohne Aufwärtspfeil befindet sich der Aktivitätstitel genau an der gleichen Stelle wie zuvor, was darauf hindeutet, dass der zusätzliche Abstand / Rand dem Aufwärtspfeil und nicht dem Aktivitätstitel zugeordnet ist.

Meine Frage ist, wie ich das Layout so ändere, dass es mit SDK 24 genauso aussieht wie mit SDK 23?

Kleine Lücke zwischen Pfeil nach oben und Titel mit SDK 23:

Large (unerwünschte) Lücke zwischen Pfeil nach oben und Titel mit SDK 24:

Hier ist mein altes build.gradle (SDK 23):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 19
        targetSdkVersion 23
        versionCode 42
        versionName "0.42"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-vision:9.0.2'
    compile 'ch.acra:acra:4.7.0'
    compile 'com.android.support:support-v4:23.4.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
    compile 'com.android.support:support-v13:23.4.0'
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    compile 'com.google.zxing:core:3.2.1'
}

Hier ist das neue build.gradle (SDK 24):

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "23.0.3"

    defaultConfig {
        applicationId "com.example.myapp"
        minSdkVersion 19
        targetSdkVersion 24
        versionCode 42
        versionName "0.42"
    }
    buildTypes {
        release {
            minifyEnabled true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    packagingOptions {
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    testCompile 'junit:junit:4.12'
    compile 'com.google.android.gms:play-services-vision:9.0.2'
    compile 'ch.acra:acra:4.7.0'
    compile 'com.android.support:support-v4:24.0.0'
    compile 'com.android.support:recyclerview-v7:24.0.0'
    compile 'com.android.support:appcompat-v7:24.0.0'
    compile 'com.android.support:design:24.0.0'
    compile 'com.android.support:support-v13:24.0.0'
    compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
    compile 'com.google.zxing:core:3.2.1'
}

Antworten auf die Frage(6)

Ihre Antwort auf die Frage