Creating styles-v21.xml

本秂侑毒 提交于 2019-11-28 07:13:11

Right click on res folder, choose New --> Android resource file, set the same name for the new file "styles", in Available qualifiers: choose the last item "Version" and finally set "Platform API level" 21.

By default, Android Studio doesn't create styles.xml (v21). What you need to do is create a folder structure like the following:

  • res/values/styles.xml
  • res/values-v21/styles.xml

And this is what you will get in Android Studio:

Then you can defined different AppTheme for different API levels.

You should create styles.xml for version 21 in values-v21 folder and android studio automatically add it as styles.xml(v21)

You have to create a value folder with values-v21 caption. and create style.xml file in this with the same name as values folder like styles.xml. Now rebuild your project.

correction to styles-v21.xml.

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="AppTheme" parent=""AppTheme.Base"">

    </style>

</resources>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!