它是很好用的布局重量和RelativeLayout的多个屏幕? [英] Is it good to use layout weights and relativelayout for multiple screens?

查看:115
本文介绍了它是很好用的布局重量和RelativeLayout的多个屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好Android的设计师,
1,我一直在想。它是一个很好的设计方法总是使用RelativeLayout的布局权重,因此它在多个屏幕尺寸工作,而不需要具有不同布局的文件夹?

Hello android designers, 1-I have been wondering. Is it a good design approach to always use RelativeLayout and layout weights so that it work on multiple screen sizes without the need of having different layout folders?

2,还有一个问题,我有大小12SP(缩放像素),看起来在中等屏幕很好,但是当我的大屏幕上运行它,它看起来真的很小一个TextView。难道不应该进行相应的扩展?根据Android的最佳实践,采用SP是良好的缩放。我看到它真的有问题,要尽量猜中了正确数字为每个屏幕尺寸为12SP已经采取了mnultiple猜测,直到我发现,这将应用程序相对于其他组件我的西装

2-Another question, I have a textview with size 12sp (scaled pixel) that looks good on medium screens but when I run it on large screen it looks really small. Shouldn't it be scaling accordingly? According to android best practices,using sp is good for scaling. I see it really problematic, to try to guess the correct number for each screen size as 12sp already took mnultiple guesses till I found that this would suit my application relative to other components

请分享您的经验/咨询。我总是搞不清它
谢谢

Please share your experience/advice. I am always confused about it Thanks

推荐答案

一想到要记住约DIP(密度独立像素)和SP(缩放像素(?))是,他们已调整的的密度屏幕。通过引入高密度的设备,这些标准将不得不由谷歌进行修改。

One think to keep in mind about Dip (density independent pixels) and sp (scaling pixels (?)) is that they are tuned for medium density screens. With the introduction of high-density devices, these standards are going to have to be revised by Google.

随着中说:


  1. 我在使用RelativeLayouts和重量比我用明确的DIP更好的运气。我通常使用的LinearLayout代替RelativeLayout--但只要元件相对于定位的海誓山盟,而不是绝对没有引起太大问题,如果它是一个RelativeLayout的或的LinearLayout或别的东西完全。

  1. I have better luck using RelativeLayouts and weights than I do with using explicit DIP. I usually use LinearLayout instead of RelativeLayout-- but as long as elements are positioned relative to eachother instead of absolutely it doesn't quite matter if it's a RelativeLayout or a LinearLayout or something else entirely.

这是happens-牢记12SP是小,这将是在大屏幕上的小的文字。相反缩放字体,缩放TextView--例如,在你的TextView中心您的文字,让你的TextView中占据半个屏幕(使用体重,无论屏幕大小)。

That is what happens- keep in mind 12sp is "small", and it will be "small" text on large screens. Instead of scaling the font, scale the TextView-- for example, center your text in your TextView and have your TextView take up half the screen (using Weight, no matter the screen size).

请记住,事情的将会的外观不同屏幕上的不同sizes--的关键是要确保它看起来的的每个大小,而不是相同的。

Remember that things will look different on different screen sizes-- the trick is to make sure it looks good on each size, as opposed to identical.

这篇关于它是很好用的布局重量和RelativeLayout的多个屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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