How does one get dimens.xml (sw600dp) into Android Studio?

前端 未结 2 822
轻奢々
轻奢々 2020-12-31 14:50

I inherited the values folder structure shown below.

For over an hour I\'ve Googled and looked and pulled down menus in Android Studio 1.2.2 an

2条回答
  •  悲哀的现实
    2020-12-31 15:17

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

    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.

    To add a resource directory from within Android Studio:

    1. Right-click over res/

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

    Android Studio New Resource Directory

    1. Choose your resource type in the "Resource type" drop-down (in this case, values)

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

    3. Click the >> button

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

    5. Click OK to close the dialog and create the directory

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

提交回复
热议问题