android中怎样适应多个屏幕

引用
This is a virtual pixel unit that you would use when defining a layout’s UI in order to express the layout’s dimensions or position in a density-independent way. The density-independent pixel is equivalent to one physical pixel on a 160 DPI screen, which is the baseline density assumed by the system of a “medium”-density screen. At runtime, the system transparently handles any scaling of the DP units as necessary, based on the actual density of the screen in use. The conversion of DP units to screen pixels is simple: pixels = DP * (DPI / 160). For example, on a 240 DPI screen, 1 DP equals 1.5 physical pixels. Always use DP units when defining your application’s UI to ensure that the UI displays properly on screens with different densities.


ui做设计的时候应该以160dpi作为基准,

引用
75 × 75 for low-density screens (i.e. ×0.75);
100 × 100 for medium-density screens (our baseline);
150 × 150 for high-density screens (×1.5);
200 × 200 for extra high-density screens (×2.0). (We’re concerned with only lDPI, mDPI and hDPI for Android smartphone apps.)


然后根据这个叫美工提供不同的icon大小

Android DP / PX converter
http://labs.skinkers.com/content/android_dp_px_calculator/


引用
视觉在根据交互原型进行设计的时候,可以考虑以mdpi,也就是320×480为蓝本进行设计,因为Android一般采用dp为单位,而我们设计的时候一般是px为单位的,这个就涉及到一个单位转换的问题,而在mdpi下,px和dp是1:1的关系,这样在标注坐标的时候能够很方便的进行单位转换,例如我们以320×480为蓝本的话,在photoshop测量的间距为10px,我们在给到RD时的坐标可以直接标注为10dp;因为dp的单位是可以程序自己去适配不用dpi屏幕的,所以就算设计三套不同dpi的图,一般也只用对mdpi的设计图进行坐标定位,这个坐标的标注可以用在所有dpi的资源上;
因为现在Android又添加了xhdpi(类似iPhone4的960×640的分辨率)的支持,假如我们在设计有(xhdpihdpi/mdpi/ldpi)四套不同dpi的图片资源时,因为之前提到以mdpi为蓝本做第一个dpi的设计,相应的我们把mdpi的比例设定为1,相应的不同dpi的图片资源尺寸的比例关系可以是xhdpi:hdpi:mdpi:ldpi等于2:1.5:1:0.75,也就是说,第一套图为mdpi的资源图片,xhpi可以大小调整到200%,hdpi可以调整到150%,ldpi则是75%;



引用
视觉设计的时候就像前面说到的一样,可以优先以320×480的大小去设计一套,在用到不同dpi的时候,可以把320×480设计psd里所有APP要用到的控件单独做一个控件库的psd,psd的所有控件图层是基于形状工具绘制的,每个分辨率都做一个控件库的psd,然后可以直接让美工根据控件库的psd切图给RD使用了,先做完mdpi的控件psd后,其它dpi的控件库的psd可以依照上面说到的比例关系进行大小的调整,例如,hdpi的控件psd也就是把mdpi里的每个控件放大到150%,有时候放大缩小psd里的图片会有些半透明的虚边,细微调整即可,如果在设计mdpi的时候,每个控件的大小能够尽量的被4整除,那么基本上就可以直接放大和缩小控件大小而不用担心虚边的问题,当然也不能完全限制在大小被4整除的死胡同里,这样也容易局限视觉设计,只是在视觉设计完成后,可以尽量的去调整在,如果视觉上有些控件在大小调整到被4整除的范围里,界面整体的比如不太合适,或者很影响视觉设计,也不必去过分强求。




ref: http://stackoverflow.com/questions/6403619/how-to-support-all-the-different-resolutions-of-android-products


ref: http://coding.smashingmagazine.com/2011/06/30/designing-for-android/

http://developer.android.com/guide/practices/screens_support.html#support

http://www.eoeandroid.com/thread-173973-1-1.html

猜你喜欢

转载自dengyin2000.iteye.com/blog/1608765