简体   繁体   English

"Android Studio 升级后无法再使用 screenOrientation 肖像"

[英]Can no longer use screenOrientation portrait after Android Studio upgrade

I have just upgraded Android Studio and am now getting an error on android:screenOrientation="portrait".我刚刚升级了 Android Studio,现在在 android:screenOrientation="portrait" 上出现错误。 It says it is expecting "unspecified" or "fullSensor" to provide Chrome OS devices with a great experience.它表示希望“未指定”或“fullSensor”能够为 Chrome OS 设备提供出色的体验。 Is there some way around this?有没有办法解决这个问题? I have tried putting in the manifest but that doesn't work.我曾尝试放入清单,但这不起作用。 What am I missing, portrait still appears to be an option in the documentation?我错过了什么,肖像似乎仍然是文档中的一个选项?

也许您可以使用 this.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); 请求 onCreate 方法的方向。

"

将此添加到您的活动的清单文件中

<activity android:screenOrientation="unspecified | fullSensor">

暂无
暂无

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

相关问题 Android studio 3.6 给 android:screenOrientation=&quot;portrait&quot; 划红线,需要更改 android:screenOrientation=&quot;fullSensor&quot; 吗? - Android studio 3.6 give an redline for android:screenOrientation="portrait", need to change android:screenOrientation="fullSensor"? android:screenOrientation =“ portrait”在豆形软糖中被忽略 - android:screenOrientation=“portrait” is ignored in Jellybean android:screenOrientation =“ portrait”在一部中文键盘上不起作用 - android:screenOrientation=“portrait” is not working on one Chinese Pad 如何为相机设置android:screenOrientation =“ portrait” - How to set android:screenOrientation=“portrait” for Camera 当screenOrientation在清单中设置为横向时,如何在对话框活动中使用纵向布局? - How can I use a portrait layout in a Dialog Activity, when screenOrientation is set to landscape in the Manifest? 锁定屏幕方向不是永久的(android:screenOrientation =“纵向”) - Locking screen orientation isn't permanent (android:screenOrientation=“portrait”) android:screenOrientation =“ portrait”在运行棉花糖的Nexus 5x上被忽略 - android:screenOrientation=“portrait” ignored on a Nexus 5x running Marshmallow Android Studio升级后出现NoSuchElementException - NoSuchElementException after Android Studio upgrade 升级到Android Studio 2.3后无法构建任何项目 - Can't build any project after upgrade to Android Studio 2.3 即使指定了android:screenOrientation =“ portrait”,Android在景观中的启动活动(来自库项目) - Android starting activity (from library project) in landscape even when specified android:screenOrientation=“portrait”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM