如何管理不同的分辨率和不同的DPI布局文件夹? [英] How to manage the layout folders for different resolutions and different dpi?
问题描述
我有怀疑,我们将如何来创建不同的布局,以支持我们知道我们将要创建的res文件夹不同的布局(MDPI,华电国际,xhdpi,xxhdpi,xxxhdpi ..)所有Android手机devices.As。
什么是我的问题是,如:我有两个手机说摩托E(253dpi)和三星Galaxy E7(267dpi),其中两个都xhpdi.Now我会为them.But创建xhdpi这里两个屏幕分辨率不同(MOTO E(分别540x960)和E7(720x1280))。
现在,如果我给在xhpdi xml.Whether一些硬codeD值我的布局仍然是相同的两个设备?没有任何对齐问题?
I have doubt that how we are going to create the different layouts to support all android mobile devices.As we know that we will be creating different layouts(mdpi,hdpi,xhdpi,xxhdpi,xxxhdpi..) in res folder. What is my question is eg:I am having two mobiles say moto e(253dpi) and samsung galaxy e7(267dpi) where both are xhpdi.Now I will be creating xhdpi for them.But here the two screen resolutions differs(moto e(540x960) and e7(720x1280) respectively). Now if I give some hard coded values in xhpdi xml.Whether my layout remains same for both devices?without any alignment issues?
推荐答案
使用,如果你想拥有专用于平板电脑的布局下列文件夹:
layout-large-mdpi (1024x600)
layout-large-xhdpi (1200x1920)
layout-xlarge-mdpi (1280x800)
layout-xlarge-xhdpi (2560x1600)
有关手机:
res/drawable (default)
res/drawable-ldpi (240x320)
res/drawable-mdpi (320x480)
res/drawable-hdpi (480x800)
res/drawable-xhdpi (720x1280)
res/drawable-xxhdpi (1080x1920)
res/drawable-xxxhdpi (1440X2560)
有关手机Dinems:
Dinems for mobiles:
res/values/dimens.xml(default)
res/values-ldpi/dimens.xml (240x320)
res/values-mdpi/dimens.xml (320x480)
res/values-hdpi/dimens.xml (480x800)
res/values-xhdpi/dimens.xml (720x1280)
res/values-xxhdpi/dimens.xml (1080x1920)
这篇关于如何管理不同的分辨率和不同的DPI布局文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!