如何将dimens.xml(sw600dp)放入Android Studio? [英] How does one get dimens.xml (sw600dp) into Android Studio?

查看:120
本文介绍了如何将dimens.xml(sw600dp)放入Android Studio?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我继承了如下所示的values文件夹结构.

I inherited the values folder structure shown below.

一个多小时以来,我已经在Google Studio中搜索并查看并下拉菜单,并尝试创建文件和文件夹,但是我所做的任何事情都不允许我添加例如dimens.xml (sw720dp).

For over an hour I've Googled and looked and pulled down menus in Android Studio 1.2.2 and tried creating files and folders but nothing I have done lets me add, for instance, dimens.xml (sw720dp).

我删除了dimens.xml (sw720dp - landscape),因为landscape不符合我的需求.

I deleted dimens.xml (sw720dp - landscape) because landscape didn't suit my needs.

谁创建了文件夹结构,为使dimens.xml (sw600dp)出现在结构中,他们采取了哪些步骤?

What steps did whoever created the folder structure take in order to get dimens.xml (sw600dp) to appear in the structure?

我需要采取什么步骤来获取具有sw<N>dp文件命名约定的dimens.xml文件?如何获得dimens.xml (sw720dp)所属的位置?

What steps do I need to take to get a dimens.xml file with the sw<N>dp file naming convention? How do I get dimens.xml (sw720dp) where it belongs?

您可以忽略其余部分.我只是在显示我尝试过的东西,没有一个能正常工作.

You can ignore the rest of this. I'm just showing that I've TRIED stuff, none of which works right.

我应该右键单击valuesdimens.xml (2)吗?那怎么办?

Am I supposed to right-click values or dimens.xml (2)? What then?

这是我做的和没有做的事情:

Here's what I did and it didn't do as I need:

我也尝试过:

编辑

我还尝试了复制sw600dp文件.没有运气:

I also tried copying the sw600dp file. No luck:

这很难.

推荐答案

我需要采取什么步骤来获取带有swdp文件命名约定的dimens.xml文件?

What steps do I need to take to get a dimens.xml file with the swdp file naming convention?

首先,如果您将项目树上方的下拉菜单从"Android"更改为"Project",那么您可能会过得更加快乐,这向您展示了项目的实际文件系统视图.

First, you will probably be happier with life if you change the drop-down above your project tree from "Android" to "Project", which shows you an actual filesystem view of your project.

要在Android Studio中添加资源目录,请执行以下操作:

To add a resource directory from within Android Studio:

  1. 右键单击res/

从上下文菜单中选择新建">"Android资源目录"以打开新建资源目录"对话框:

Choose New > "Android resource directory" from the context menu to bring up the New Resource Directory dialog:

  1. 在资源类型"下拉列表中选择您的资源类型(在本例中为values)

在可用的限定词"列表中单击所需的限定词(在本例中为最小屏幕宽度").

Click on your desired qualifier (in this case, "Smallest screen width") in the "Available qualifiers" list.

单击>>按钮

在显示的字段中,填写您的数值(在这种情况下为600)

In the field that appears, fill in your numeric value (in this case, 600)

单击确定"关闭对话框并创建目录

Click OK to close the dialog and create the directory

要将dimens.xml添加到该目录,请右键单击新创建的目录,然后从上下文菜单中选择新建">值资源文件".

To add dimens.xml to that directory, right-click over the newly-created directory and choose New > "Values resource file" from the context menu.

这篇关于如何将dimens.xml(sw600dp)放入Android Studio?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆