针对android系统中的多个屏幕尺寸...如何? [英] Targeting multiple screen sizes in android...How to?
问题描述
我为针对所有的屏幕大小和像素密度(包括片剂7,9.1和10英寸)我的应用程序创建的布局。我有,我一直没能阅读文档后,理解好,即使几个疑问。目前,我已经做即四种布局的布局大,*的正常的*,小,*的 -sw320dp 的*和 -sw480dp 。我感到困惑的图像密度。
我指的是Android提供了默认( ic_launcher.png
图像在绘制,华电国际
,绘制-LDPI
,绘制-MDPI
,绘制-xhdpi
和绘制-xxhdpi
)。我已经做了样品布局迈出了图像视图,并给予SRC为 ic_launcher.png 。但是,不显示任何设备或模拟器上这个形象。
- 请我需要指定不同大小的图像?如果是这样,在哪些文件夹?因为对于大屏幕的布局应采取更大的图像。
- 请
华电国际
,LDPI
和MDPI
暗示类似大小的图像以不同密度或大小不同而已? 图片 - 此外,在布局屏幕较大的情况下,我应该参照绘图资源作为大尺寸图像(如果我采取小型,中型,大型图片),或将Android把它从
绘制,华电国际
?
您只需要把图像正确的文件夹:使用华电国际
+ MDPI
+ xhdpi
+ xxhdpi
LDPI
仅在 1%的Android设备,你不应该让他们。
您也可以为大屏幕创造不同的布局
I am creating layouts for targeting my application for all screen sizes and densities (including tablets 7,9.1 and 10 inches). I have a few queries for which I haven't been able to understand well even though after reading the documentation. Currently, I have made four layouts namely layout-large,*normal*,small,*-sw320dp* and -sw480dp. I am confused about images densities.
I am referring to the image that android provides by default (ic_launcher.png
under drawable-hdpi
, drawable-ldpi
, drawable-mdpi
, drawable-xhdpi
and drawable-xxhdpi
.) I have made a sample layout taken a image view and given src as ic_launcher.png. However, this image is not displayed on any device or emulator.
- Do I need to specify different sized images? If so, in which folders? Because layouts for larger screens should take larger images.
- Do
hdpi
,ldpi
, andmdpi
imply similar sized images with different density or images with different sizes only? - Also in case of layout for larger screen, should I refer to drawables for large sized images (if I am taking small, medium, large images), or will Android take it from
drawable-hdpi
?
You only need to put the images in the right folder: using hdpi
+ mdpi
+ xhdpi
+ xxhdpi
ldpi
is only 1% of the android devices and you should not make them.
you also can create different layouts for larger screens
这篇关于针对android系统中的多个屏幕尺寸...如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!