问题描述
当我创建一个至少使用 API14 的新项目时,我的项目中没有 values-21
或 values-22
文件夹.我在任何地方都没有看到任何 style.XML,那么我应该如何为 Lollipop 输入 XML 代码?
When I create a new project with API14 as minimum, then there is no values-21
or values-22
folder in my project. I don't see any styles.XML anywhere, so how should I put in XML code for just Lollipop?
我使用 Android Studio 1.0.1,并且安装了 SDK 21、21.1.1、24.0.2.
I use Android Studio 1.0.1, and I have SDK 21, 21.1.1, 24.0.2 installed.
推荐答案
更新:自 API 22
发布以来.API 23
是同样的想法.
Updated: Since API 22
has been released. API 23
is the same idea.
右键点击RES
文件夹
然后输入values-v22
作为目录名,选择xml作为资源类型.
Then type values-v22
as the directory name and choose xml as the resource type.
如果您没有看到 values-v22
出现,请点击
屏幕顶部的项目下拉菜单,如下所示.例如从安卓到项目
If you do NOT see the values-v22
show up, click
the Project pulldown at the top of the screen like so. e.g. Change from Android to Project
现在右键单击values文件夹
中的styles.xml
并选择复制
Now right click styles.xml
in the values folder
and choose copy
现在右键单击 values-v22
文件夹并单击粘贴.
Now right click the values-v22
folder and click paste.
您应该会看到此弹出窗口
You should see this popup
点击ok
此时您应该可以开始了.
At this point you should be good to go.
这篇关于values-21、values-22 或 values-xx 文件夹在 Android Studio 1.0 之后消失了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!