检查取向对Android手机 [英] Check orientation on Android phone

查看:114
本文介绍了检查取向对Android手机的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何检查Android手机在横向或纵向?

How can I check if the Android phone is in Landscape or Portrait?

推荐答案

目前的配置,用来确定检索哪些资源等,如可从资源配置对象为:

The current configuration, as used to determine which resources to retrieve etc, as available from the Resources' Configuration object as:

getResources().getConfiguration().orientation

<一个href="http://developer.android.com/reference/android/content/res/Configuration.html#orientation">http://developer.android.com/reference/android/content/res/Configuration.html#orientation

这篇关于检查取向对Android手机的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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