小编Nic*_*ick的帖子

API 21下的主要暗色机器人

我想为状态栏着色,以便在Android 5.0中更好看.我想设置三种颜色的primarydark,light和accent.

但我的最低API是15.有没有机会在API lvl 21下使用它?或者我必须用min创建一个单独的应用程序.sdk 21?

编辑:现在我得到我需要的一切,但statisbar颜色不会改变.

这是我的values-v21/styles.xml

    <?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="AppBaseTheme" parent="android:Theme.Material.Light">
            <!-- API 21 theme customizations can go here. -->
    <!-- Main theme colors -->
    <!--   your app branding color for the app bar -->
    <item name="android:colorPrimary">@color/primary</item>
    <!--   darker variant for the status bar and contextual app bars -->
    <item name="android:colorPrimaryDark">@color/primary_dark</item>
    <!--   theme UI controls like checkboxes and text fields -->
    <item name="android:colorAccent">@color/accent</item>
        </style>
</resources>
Run Code Online (Sandbox Code Playgroud)

这是普通的style.xml

<resources>

    <!--
        Base application theme, dependent on API level. This …
Run Code Online (Sandbox Code Playgroud)

android android-5.0-lollipop

3
推荐指数
1
解决办法
2万
查看次数

标签 统计

android ×1

android-5.0-lollipop ×1