屏幕分辨率/物理尺寸 [英] Screen resolution / Physical size

查看:190
本文介绍了屏幕分辨率/物理尺寸的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我执行的Andr​​oid(API 10)的应用程序。我对平板电脑(据说)和移动电话的几个设计。关于previous句话听起来有点愚蠢:在我看来,布局应根据设备的物理尺寸采摘 - 不解决,否则可能出现的高分辨率呈现,比如说,5x5的网格一个电话,在相当混乱,充分小型的方式。为了通过物理尺寸为师,我得使用的 / RES /布局 - 的*文件夹。同意?

I'm implementing an app for Android(API 10). I have few designs for tablet(supposedly) and for mobile phone. Regarding the previous sentence it might sound a bit stupid: in my opinion layouts should be picked according to device's physical size - not resolution, otherwise there might be a phone with high resolution that renders, say, a grid of 5x5, in rather confusing, inadequately small-sized way. In order to provide division by physical size I gotta use /res/layout-* folders. Agreed ?

另外:我对多屏指南的定义上物理尺寸。你介意解释什么物理尺寸是Android中的术语的含义,什么它是衡量?是否有任何的与DPI相关

Also: I'm a bit confused about multiple-screens guide's definition on physical size. Would you mind explaining what physical size is in terms of Android mean, what it's measured in? Is there any correlation with dpi?

感谢。

推荐答案

一个用于API级别10的解决方法可能是这样的:

A workaround for api level 10 could be something like this:


  1. 使用COMPAT LIB从SDK,让您可以与片段设计。

  1. use the compat lib from the SDK so that you can design with fragments.

假设一切之前的Andr​​oid 3.0是一款手机。例如使用您的布局文件布局/ *为这个(其余将根据它,除非被覆盖的)。这个假设基本上只有错原三星Galaxy Tab 7自2009年。

Assume everything before android 3 is a phone. For example use your layout files in layout/* for this (and the rest will be based it on unless overriden). This assumption is basically only wrong for the original Samsung Galaxy Tab 7" from 2009.

假设在Android 3.x的一切都是平板电脑(他们是),所以如果你想要做一些具体的平板电脑布局,并让它们在布局-V11(也许还布局V12是否有具体的任何东西安卓3.1)。平板特定的布局可能意味着你不同的安排你的碎片和/或同时显示多个片段。

Assume everything on android 3.x is a tablet (they are), so do some tablet specific layout if you want and have them under layout-v11 (and maybe also layout-v12 if there is anything specific to android 3.1). Tablet specific layout could mean that you arrange your fragments differently and/or show multiple fragments at the same time.

一切新(安卓3.2+),可以使用从API级别13.新的东西,如布局sw600dp /对一些布局等等等等的http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts

Everything newer (android 3.2+) you can use the new stuff from api level 13. Such as layout-sw600dp/ for some layouts etc etc. http://developer.android.com/guide/practices/screens_support.html#DeclaringTabletLayouts

这篇关于屏幕分辨率/物理尺寸的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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