- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想为每个密度使用单独的 values
,所以我为每个密度创建了不同的 values
文件夹,
values
values-ldpi
values-mdpi
values-hdpi
values-xhdpi
values-xxhdpi
在每个 strings.xml
文件中,我写了密度(对于 values-xxhdpi
,我有一个字符串,文本为“xxhdpi
"), 但是当我在 GS4 上运行它时,我得到了 "mdpi
"字符串,
我也确实创建了单独的 layout
文件夹,但始终采用 layout-mdpi
密度
任何可能发生的事情的线索?
最佳答案
根据密度而不是大小来定义布局对我来说有点可笑。 Drawable 和其他类似资源取决于密度,但布局取决于大小。
请看这里:http://developer.android.com/guide/practices/screens_support.html
对于值,您可以尝试使用 values-normal、values-large 等。
我写这篇文章虽然你所做的应该根据这个线程工作:https://stackoverflow.com/a/9639280/693752
另外,您对这个资源很感兴趣: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch
----更新----
看这个来自 GodFather 的回答: https://stackoverflow.com/a/20521720/693752
(Note that density qualifiers are even fuzzier -- -mdpi will be used for any device density, in the absence of a better match, as density qualifiers are designed to be used only on drawable directories, where Android can apply resampling algorithms. Using density qualifiers on anything other than drawables and maybe dimension resources is a code smell.)
关于android - Galaxy S4 从 MDPI 中获取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23155901/
我有各种不同像素密度的全套图像,我需要将位图资源放入 drawables 文件夹(位于 MDPI)以用作默认资源(以防止在我没有的像素密度设备上崩溃迎合,例如 xhdpi),但这意味着将 drawab
我想为 drawable-xlarge-mdpi 和 drawable-sw600dp-mdpi 提供相同的图像资源/drawable。 似乎我能做到这一点的唯一方法是在 res/下创建两个文件夹,然
我有一个 iPhone 应用程序设计 PSD,我需要适应 Android 应用程序设计。 我已经阅读了五篇不同的官方文档文章、几篇博客文章、Stack Overflow 答案、模板 PSD 文件,应有
我已经阅读了 10 篇文章,但仍然找不到 ldpi、mdpi、hdpi 和实际像素尺寸之间的任何关系!?谁能给个直截了当的答案(如果有的话!) 我基本上是在尝试制作一个启动画面,它需要在不拉伸(str
我需要设置编辑文本框的文本大小, etsamp.setTextSize(getResources().getDimension(R.dimen.font_size)); 对于所有类型的手机,设置屏幕
是否可以在 list 中指明该应用程序仅适用于 mdpi (320x480. ..)?有一个参数“supports-screens”,但是有normalScreens的意思和hdpi。 最佳答案 使用
我知道这是一个常见问题,但我没有找到解决方案。在为 Android 设计按钮时,您必须针对特定的 DPI 进行设计,但使用 MDPI 时会出现问题; 最小的 mdpi 是 320x480,所以我创建了
那九 block 图像呢? 可以使用它们代替 ? /res/drawable-hdpi/icon.png .. 72×72 /res/drawable-mdpi/icon.png …. 48×48 /
我发布了一个应用程序,其应用程序图标具有 mdpi、hdpi、xhdpi 和 xxhdpi 图像。我收到一些反馈说在 ldpi 设备上没有使用我的图标,而是使用了 android 的默认图标。 这是为
我有三台设备,分辨率分别为 320x480、1024 x 600、1280 x 800。这三台设备中有两台是平板电脑。现在这些设备中的每一个都有 160dp 的密度,因此,所有这些设备都从 drawa
我正在设计一个 Android 应用程序,我正在为不同的布局而苦苦挣扎。基本上,我在纵向上显示一个日历和一个 TextView,每次单击日历中的图 block 时都会更新它的值。我不想再在 land-
请帮我解决几个关于可绘制对象的一般性问题。 1) 如果我有一个通用壁纸应用程序(不是动态壁纸),我是否需要将图像包含在所有三个可绘制文件夹中?即使我不更改图像? 2) 我可以使用什么命令来不允许平板电
我必须为 HDPI 和 MDPI 屏幕的元素应用不同的属性。我尝试了以下代码,但它仅适用于 HDPI,不适用于 MDPI。 @media screen and (min-width: 900px) {
有没有办法避免每个分辨率有多组可绘制对象?我有将近 50 张图片(大部分是简单图标,没有使用任何需要 9-patch 的东西),在 Photoshop 中调整所有 50 张图片的大小似乎有很多多余的工
我正在尝试创建一个适用于 Samsung galaxy tab GT P1000 和 samsung galaxy tab 10.1 的应用程序;三星 galaxy tab 10.1 (1280 *
我是 Android 开发的新手(使用 Mono for Android),我读过 this , this this和其他一些questions在这里,但我不确定如何为我的应用程序提供所有必要的图标文
因此,关于这个 stackoverflow 接受的答案:How do I convert ppi into dpi for Android images? 那么,好吧,我将每个背景图像都设为那个人在答
android 图像大小不同 mdpi、hdpi、xhdpi、xxhdpi ?我有一个 mdpi 图像 20*20 如何测量 hdpi、xhdpi、xxhdpi 如何制作其他分辨率图像由于 Andro
我只在每个文件夹中放置了 mdpi 和 hdpi 图像,但是当我在 ldpi 设备上运行我的应用程序时,它不会从 mdpi 文件夹中选择图像,而是从 hdpi 文件夹中选择图像。这是为什么?关于我做错
我有一个应用程序,它可以在手机和平板电脑上运行,而且我支持各种屏幕尺寸。 某些设备(如摩托罗拉 XOOM 和三星 Galaxy Tab 10.1)的屏幕尺寸最受以下配置下的可绘制对象支持: dra
我是一名优秀的程序员,十分优秀!