更改为新的materin主题后缺少后退按钮

Ido*_*dob 2 android android-actionbar material-design

从Holo主题更改为新材质主题(Theme.AppCompat.Light.DarkActionBar)后,我的操作栏中的所有后退按钮都消失了.

这是我的应用程序应该有一个后退按钮:

<activity
        android:name=".ui.LeagueActivity"
        android:label="@string/title_activity_league"
        android:parentActivityName=".ui.LeagueListActivity" >
        <!-- Parent activity meta-data to support 4.0 and lower -->
        <meta-data
            android:name="android.support.PARENT_ACTIVITY"
            android:value=".ui.LeagueListActivity" />

</activity>
Run Code Online (Sandbox Code Playgroud)

我的应用主题:

<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">

    <!-- App core design -->
    <item name="colorPrimary">@color/green</item>
    <item name="colorPrimaryDark">@color/greenDark</item>
    <item name="colorAccent">@android:color/white</item>

    <item name="android:textColorPrimary">@android:color/white</item>

</style>
Run Code Online (Sandbox Code Playgroud)

Sha*_*aun 5

getSupportActionBar().setDisplayHomeAsUpEnabled(true);
Run Code Online (Sandbox Code Playgroud)

在您的活动的onCreate中,它需要一个后退/最多为父按钮.

这为我修好了.