在Android 3.2的屏幕支持(API 13级) [英] Screen Support in Android 3.2 (API level 13)

查看:114
本文介绍了在Android 3.2的屏幕支持(API 13级)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据写本文档中的说明( DeclaringTabletLayouts )老组中去precated(小,中,大,超大),这就是为什么我们要迁移到Android 3.2的定义的新技术。


  

请注意:从Android 3.2开始(API等级13),这些尺寸组是
  赞成新技术pcated管理的屏幕尺寸去$ P $基于
  可用的屏幕宽度。如果你正在开发Android 3.2
  和更大的,请参阅声明平板电脑布局的Andr​​oid 3.2以上
  信息。


如何我们做不同的布局小与正常VS新技术的大屏幕?我试了一下,并没有找到一个解决方案,我想对每一组不同的布局,和记说,这就是德precated。

旧方式分类:

  XLARGE屏幕至少960dp点¯x720dp
大屏幕至少640dp点¯x480dp
标准屏幕至少470dp点¯x320dp
小屏幕至少426dp点¯x320dp

新的方式:

  320dp:一个典型的手机屏幕(240×320 LDPI,MDPI分辨率320x480,480x800的华电国际等)。
480dp:一个中间人的平板电脑,如条纹(480x800的MDPI)。
为600dp:7平板电脑(600x1024 MDPI)。
720dp:10平板电脑(720x1280 MDPI,800x1280 MDPI等)。RES /布局sw320dp / main_activity.xml#针对手机(小于600dp的可用宽度)
RES /布局sw600dp / main_activity.xml#针对7片(宽度为600 dp和更大的)
RES /布局sw720dp / main_activity.xml#针对10片(720dp宽和大)


解决方案

这是你可以通过创建 layout.xml 价值观文件中使用它在文档中很好地解释和创建别名指向替代布局。你可以创造价值,大,价值-SW-600等,并指向要选择特定类型的布局别名。

 <?XML版本=1.0编码=UTF-8&GT?;
    <资源>
<项目类型=布局NAME =登录> @布局/ login_large
< /项目> < /资源>

请参阅 http://developer.android.com/training/multiscreen/screensizes。 HTML ,因为它很好地解释了如何开发的最佳途径多个屏幕。

According to the note written in this documentation (DeclaringTabletLayouts), the old groups was deprecated (small, normal, large, and xlarge), which is why we have to migrate to the new technique defined in Android 3.2.

Note: Beginning with Android 3.2 (API level 13), these size groups are deprecated in favor of a new technique for managing screen sizes based on the available screen width. If you're developing for Android 3.2 and greater, see Declaring Tablet Layouts for Android 3.2 for more information.

How do we make different layouts for small vs normal vs large screens with the new technique? I tried it and didn't find a solution, I want to set a different layout for each one, and the note said that is deprecated.

Old way classification :

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

New way :

320dp: a typical phone screen (240x320 ldpi, 320x480 mdpi, 480x800 hdpi, etc).
480dp: a tweener tablet like the Streak (480x800 mdpi).
600dp: a 7" tablet (600x1024 mdpi).
720dp: a 10" tablet (720x1280 mdpi, 800x1280 mdpi, etc).

res/layout-sw320dp/main_activity.xml # For handsets (smaller than 600dp available width)
res/layout-sw600dp/main_activity.xml # For 7" tablets (600dp wide and bigger)
res/layout-sw720dp/main_activity.xml # For 10" tablets (720dp wide and bigger)

解决方案

It is well explained in the documentation that you can use it by creating layout.xml in values file, and creating aliases to point to alternative layouts. You can create values-large,values-sw-600, etc. and point to the layout alias you want to choose for that particular type.

  <?xml version="1.0" encoding="utf-8"?>
    <resources>
<item type="layout" name="login">@layout/login_large
</item>

 </resources>

Refer to http://developer.android.com/training/multiscreen/screensizes.html, as it explains well how to develop for multiple screens in the best way.

这篇关于在Android 3.2的屏幕支持(API 13级)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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