难点了解如何支持多屏 [英] Difficulty to understand how to support multiple screen

查看:146
本文介绍了难点了解如何支持多屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到的计算器这么多的问题,如何支持多屏幕。但是,大部分的答案提供此链接和的这个。而在第一个环节我有这个。我用的屏幕工作大小不一的第一次,所以请帮助我。

  XLARGE屏幕至少960dp x 720dp
大屏幕至少640dp x 480dp
正常屏幕至少470dp x 320dp
小屏幕至少426dp x 320dp
 

而如果 xhdpi 他们提出的 320密度。我很困惑,所以我有以下几个问题。

  1. 就像如果我想要创建XLARGE屏幕背景图片,然后 960dp x 720dp 意味着我必须创建图像的宽720像素,高960像素分辨率为320 在纵向模式?

  2. 如果我想创建大屏幕的背景图像,然后 640dp x 480dpp 意味着我必须创建图像的宽度480像素,高度640像素在纵向模式下的分辨率超过200

  3. 以上尺寸为横向模式,即 960dp 的宽度和 720dp 的高度?

解决方案

在Android的 -

  PX = DP *(DPI / 160)
 

  1. 因此​​,在你的第一个问题 960dp x 720dp 320dpi 办法 1920px x 1440px 在横向模式XLARGE屏幕采用上面的公式。

  2. 640dp x 480dp 240dpi 办法 960px x 720px 在横向模式的大屏幕。

<一个href="https://blogs.captechconsulting.com/blog/steven-byle/understanding-density-independence-android"相对=nofollow>要详细了解检查。

I have seen so many questions on StackOverFlow how to support multiple screens. But most of the answers provide this link and this. And in the first one link I have got this. I am working with screen sizes first time so please help me.

xlarge screens are at least 960dp x 720dp
large screens are at least 640dp x 480dp
normal screens are at least 470dp x 320dp
small screens are at least 426dp x 320dp

And in case of xhdpi they suggest 320 density. I am confused so I have following questions.

  1. Like if I want to create Background image for xlarge screen then 960dp x 720dp means I have to create image with width 720 pixels and height 960 pixels and resolution 320 in portrait mode?

  2. And if I want to create Background image for large screen then 640dp x 480dpp means I have to create image with width 480 pixels and height 640 pixels and resolution more than 200 in portrait mode?

  3. The sizes above is for landscape mode i.e 960dp for width and 720dp for height ?

解决方案

In android-

px = dp * (dpi / 160)

  1. So in your first question 960dp x 720dp at 320dpi means 1920px x 1440px for xlarge screen in landscape mode using above formula.

  2. 640dp x 480dp at 240dpi means 960px x 720px for large screen in landscape mode.

To learn more about check this.

这篇关于难点了解如何支持多屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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