Android的:在横向模式下改变方向 [英] Android: orientation change in landscape mode

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

问题描述

当取向的变化在横向模式下,启动一个新的活动。回到这个活动后,当定位在Android的肖像模式。

When orientation changes in landscape mode, start a new activity. After back to this activity when orientation in portrait mode in Android.

推荐答案

在Android清单文件的XML为您的应用程序发生此code在那里的活动所需的表格。每种形式都有其自身的活动,你可以指定你想有景观哪些。查找名称列出的活动。名称

In the Android Manifest file xml for your app place this code in there in the activity for the forms that you want. Each form will have its own activity and you can specify which ones that you want to have as landscape. Find the name for the activity listed ".name"

 <activity android:name=".name"
              android:label="@string/app_name"
              android:screenOrientation="landscape">
        <intent-filter>

真正的关键,这是确保你指定screenOrientation =风景结果
这将取代自动旋转传感器,它不会为该屏幕工作。

The real key to this is make sure you specify screenOrientation="landscape"
this overrides the auto rotate sensor and it will not work for that screen.

这篇关于Android的:在横向模式下改变方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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