简体   繁体   English

平板电脑的设计应用程序以支持不同的屏幕尺寸。

[英]Designing application for tablets to support different screen sizes.

I am developing an enterprise application for android tablets and i have limited the orientation only to landscape. 我正在为android平板电脑开发企业应用程序,并且我仅将方向限制为横向。 As the screen sizes for different tablet devices varies (7" or 10"), what is the best practice to design the layouts to support all the tablet devices? 随着不同平板电脑设备的屏幕尺寸变化(7“或10”),设计布局以支持所有平板电脑的最佳实践是什么?

Use the same layout but different dimensions. 使用相同的布局,但使用不同的尺寸。 Example: 例:

res/values-sw600dp/dimensions.xml   // For 7” tablets (600dp wide and bigger)
res/values-sw720dp/dimensions.xml   // For 10” tablets (720dp wide and bigger)

This part of the documentation is very relevant to what you are asking: http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts 本文档的这一部分与您要问的内容非常相关: http : //developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts

The key idea is to have different layout files that will be loaded for different screen configurations. 关键思想是要为不同的屏幕配置加载不同的布局文件。

Also make sure you do not use AbsoluteLayout because it has problems resizing. 还要确保不要使用AbsoluteLayout,因为它在调整大小时会遇到问题。

Define metrics by dpi's rather than pixels. 通过dpi而不是像素定义指标。 It helps to avoid losing resolution when screen size gets larger. 当屏幕尺寸变大时,它有助于避免失去分辨率。

Other than these, all important things are in the documentation. 除此之外,所有重要的内容都在文档中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM