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

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

问题描述

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

I inherited the values folder structure shown below.

一个多小时以来,我在 Android Studio 1.2.2 中搜索并查看并下拉菜单,并尝试创建文件和文件夹,但我所做的一切都没有让我添加,例如,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.

我应该右键单击values 还是dimens.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"更改为项目",您可能会对生活更满意,这会显示您项目的实际文件系统视图.

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天全站免登陆