如何设计任何屏幕尺寸和屏幕密度-Android中的密度(Android中的多屏手机) [英] how to design any screen size and - density in Android(Multi screen for mobiles in Android)

查看:140
本文介绍了如何设计任何屏幕尺寸和屏幕密度-Android中的密度(Android中的多屏手机)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不使用values文件夹中的尺寸的情况下在Android手机中处理多屏设计.

How to handle design in multi screen for mobiles in Android without using dimention in values folder.

我的应用程序支持所有android手机,但我的设计存在问题,因为我在values文件夹中使用dimen来处理它.

My application it's support all android mobiles, and I had a problem with the design, because I'm using dimen in values folder to handle it.

因此,任何人都可以在不使用三维的情况下帮助我解决此问题.

So please anyone can help me to handle this problem without using the dimention.

推荐答案

布局兼容性是任何项目中非常重要的部分

对不起,但是您必须使用dimens处理此问题. 我认为最好的设计方法是使用密度.

sorry but you have to use dimens for handle this problem. and i think best way for design is use density.

您可以使用dimens-hdpidimens-mdpi或...

you can use dimens-hdpi or dimens-mdpi or ...

并可以使用dimens-smalldimens-large或...

and can use dimens-small or dimens-large or ...

,并且可以将它们一起使用.就像dimens-larg-mdpi

and can use both of them together. like dimens-larg-mdpi

但这很难设计.

i使用变暗的最小屏幕宽度 这种使用密度,我认为您可以处理4或5个像素的所有手机或平板电脑.

i using dimens smallest screen width this use density and i think you can handle all of phones or tablets by 4 or 5 dimens.

喜欢这张照片.

屏幕宽度dp的典型数字为:

Typical numbers for screen width dp are:

  • 320:电话屏幕(240x320 ldpi,320x480 mdpi,480x800 hdpi等).
  • 480:诸如Streak(480x800 mdpi)之类的Tweener平板电脑.
  • 600:7英寸平板电脑(600x1024).
  • 720:10英寸平板电脑(720x1280、800x1280等).
  • 如果您的设备不支持这些设备之一,则可以添加 另一个最小的屏幕宽度.
  • 320: a phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
  • 480: a tweener tablet like the Streak (480x800 mdpi).
  • 600: a 7" tablet (600x1024).
  • 720: a 10" tablet (720x1280, 800x1280, etc).
  • if you have a device don't support by one of these you can add another smallest screen width for that.

您可以在此处此处帮助您知道每英寸的手机像素.

you can read more details here , here , here and this help you know your phone pixels per inch.

示例:

您的手机具有1080 * 1920像素和5英寸大小.

you have a phone 1080*1920 pixel and 5" size.

  • 第一个公式可帮助您计算每英寸像素(dpi).
  • 第二个公式可帮助您计算像素比率.
  • 最后一个公式可帮助您计算dp.

这部手机的宽度为392 dp,最小宽度为320 dp.

this phone have 392 dp in width and smallest width for that is 320.

如果您喜欢使用dpi,请

if you like use dpi Pixel ratio can help you.

  • ldpi =>像素比= 0.75
  • mdpi =>像素比率= 1.0
  • hdpi =>像素比= 1.5
  • xhdpi =>像素比= 2
  • xxhdpi =>像素比= 3
  • xxxhdpi =>像素比= 4

这篇关于如何设计任何屏幕尺寸和屏幕密度-Android中的密度(Android中的多屏手机)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆