drawable-540x960目录名称无效[英] drawable-540x960 directory name invalid

本文是小编为大家收集整理的关于drawable-540x960目录名称无效的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

在我的应用程序中,我必须支持540x960屏幕. 我创建了一个名为:drawable-540x960的目录,用于包含此屏幕的所有图形项. 但是我得到了这个错误:invalid resource directory name drawable-540x960 这个名字出了什么问题? 谢谢, Eyal.

推荐答案

实际上您为屏幕提供了错误的目录名称. " rel =" nofollow"> https://developer.android.com/guide/practices/screens_support.html#newqualifiers

在该站点中,请参见表编号:2有关屏幕尺寸的资格

您也可以找到一行:

If the available height is a concern for you, then you can do the same using the h<N>dp qualifier. Or, even combine the w<N>dp and h<N>dp qualifiers if you need to be really specific.

用于指定屏幕尺寸540x960的使用,您需要添加如下图,它是定义该XML布局使用的宽度和高度的有效方法.

res/layout-w540dp-h960dp/any layout which you need put in side this folder

其他推荐答案

实际上答案很简单:

drawable-hdpi-960x540

1)您必须指定密度 2)您必须先命名高度

其他推荐答案

我已经尝试了不同的模拟器...最后我成功了.

    res/layout-long-port-hdpi-500x300/layout.xml  (For testing i created this emulator)
    res/layout-long-port-hdpi-960x540/layout.xml  (For Motorola Droid Razr, Motorola Droid Bionic, etc)
    res/layout-long-port-hdpi-800x480/layout.xml  (For Nexus)

本文地址:https://www.itbaoku.cn/post/102339.html

问题描述

In my application i have to support 540x960 screens. I have created a directory named: drawable-540x960 for containing all graphics items for this screen. But i get this error: invalid resource directory name drawable-540x960 What is going wrong with this name? Thanks, Eyal.

推荐答案

Actually you are giving wrong directory name for your screen .you can refer this from developer site go here https://developer.android.com/guide/practices/screens_support.html#NewQualifiers

in that site See Table No :2 for qualifers for screen size

also one line you can find in that is :

If the available height is a concern for you, then you can do the same using the h<N>dp qualifier. Or, even combine the w<N>dp and h<N>dp qualifiers if you need to be really specific.

For Specify use of Screen Size 540x960 ,you need to add layout like below and it is valid way to define width and height used for that xml layout.

res/layout-w540dp-h960dp/any layout which you need put in side this folder

其他推荐答案

Well actually the answer is quite simple:

drawable-hdpi-960x540

1) You have to specify the density 2) You have to name the height first

其他推荐答案

I have tried with different emulators...Finally i succeeded.Height should be first value.

    res/layout-long-port-hdpi-500x300/layout.xml  (For testing i created this emulator)
    res/layout-long-port-hdpi-960x540/layout.xml  (For Motorola Droid Razr, Motorola Droid Bionic, etc)
    res/layout-long-port-hdpi-800x480/layout.xml  (For Nexus)