简体   繁体   English

不同屏幕尺寸的不同资源(以像素为单位)

[英]Different resources for different screen sizes (in pixels)

Is there a build-in functionality to provide different resources for different screen sizes ( in pixels )是否有内置功能为不同的屏幕尺寸(以像素为单位)提供不同的资源

What I found is a solution to separate them by dpi (using hdpi , ldpi , mdpi or sw320dp , sw720dp folders): http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources我发现的是一种通过 dpi 将它们分开的解决方案(使用hdpildpimdpisw320dpsw720dp文件夹): http://developer.android.com/guide/topics/resources/providing-resources-html

But I don't care about densities!但我不在乎密度!
My application mostly uses Bitmaps and Canvas, and all I want is to avoid scaling (and smoothing) of these bitmaps.我的应用程序主要使用位图和 Canvas,我只想避免缩放(和平滑)这些位图。

But I don't care about densities, My application mostly uses Bitmaps and Canvas.但我不关心密度,我的应用程序主要使用位图和 Canvas。 and all I want is to avoid scaling (and smoothing) of these bitmaps.我想要的只是避免这些位图的缩放(和平滑)。

Have you tried using drawable-nodpi or raw for your bitmaps?您是否尝试过为您的位图使用drawable-nodpiraw

You can't specify by exact pixel sizes but there are 4 categories that you can use as modifiers to your layout folders.您无法按确切的像素大小指定,但有 4 个类别可用作布局文件夹的修饰符。 layout-small, layout-normal, layout-large, layout-xlarge.小布局、普通布局、大布局、大布局。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM