如何设计1080 * 1920像素屏幕的布局?哪个布局文件夹适用于Samsung galaxy S4? [英] How to design a layout for 1080*1920 pixel screens? Which layout folder works for Samsung galaxy S4?

查看:64
本文介绍了如何设计1080 * 1920像素屏幕的布局?哪个布局文件夹适用于Samsung galaxy S4?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个适用于所有类型屏幕的应用程序,但是在为Samsung Galaxy S4 1080 * 1920(5英寸屏幕)创建布局时遇到了问题.

I'm creating an application which works for all types of screens, but I'm having problems while creating layouts for the Samsung Galaxy S4 1080*1920 (5 inch screen).

由于1080 * 1920低于480dpi(XXHDPI),因此我创建了一个名为layout-sw480dp的文件夹,并将文件放置在其中.

Since 1080*1920 falls under 480dpi(XXHDPI), I have created folder called layout-sw480dp and have placed my file in there.

当我从xml视图中查看它时,它看起来很完美,但是当我运行它并检查时,对齐方式已更改.

When I look at it from xml view it looks perfect, but when I run it and check, the alignment has been changed.

我还创建了其他文件夹,例如layout-xxhdpi,然后尝试了一下,但是对齐问题仍然存在.

I have created other folders, such as layout-xxhdpi as well, and tried then but the alignment problem persists.

是否有用于放置Samsung Galaxy S4文件的特定文件夹?

Are there any specific folders to place files for Samsung Galaxy S4?

我已附加链接以显示我面临的问题.

I have attached links to show the problem I'm facing.

预先感谢

这是屏幕截图的链接

https://www.dropbox.com/s/65pqq65qm2va8jc/xml.gif

https://www.dropbox.com/s/3ewytmrt1jy7xc9/screenshot2.gif

推荐答案

如果要为S4设置布局,则需要使用 values-sw360dp 文件夹.

If you want to have a layout for your S4, you need to use the values-sw360dp folder.

转换方式如下: px * 160/dpi .在您的情况下: 1080 * 160/480 = 360 .

The conversion is like this: px * 160 / dpi. In your case: 1080 * 160 / 480 = 360.

但是无论如何,您的布局应该可以在所有设备上使用,而不仅是S4.

But anyway, your layout should work on all devices, not only the S4.

这篇关于如何设计1080 * 1920像素屏幕的布局?哪个布局文件夹适用于Samsung galaxy S4?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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