期待 'android:screenOrientation="unspecified"'或“全传感器"对于这项活动 [英] Expecting 'android:screenOrientation="unspecified"' or '"fullSensor"' for this activity

查看:46
本文介绍了期待 'android:screenOrientation="unspecified"'或“全传感器"对于这项活动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将我的 Android Studio 升级到 3.6.0.现在,我的 Manifest.xml 文件中出现以下错误.

I upgraded my Android Studio to 3.6.0. Now, I get the following error in my Manifest.xml file.

期待 'android:screenOrientation="unspecified"' 或 '"fullSensor"'对于此活动,因此用户可以在任何情况下使用该应用程序方向并在 Chrome 操作系统设备上提供出色的体验.

Expecting 'android:screenOrientation="unspecified"' or '"fullSensor"' for this activity so the user can use the application in any orientation and provide a great experience on Chrome OS devices.

我应该将其转换为fullSensor"吗?我怎样才能摆脱这个问题?

Should I convert it to "fullSensor"? How can I get rid of this problem?

我的活动方向是纵向.我想在我的活动中继续使用纵向.

Orientation of my activities is portrait. I want to keep using portrait orientation in my activities.

推荐答案

这是一种警告,通知开发人员对于大屏幕设备,限制方向是不好的.但是,如果您的应用程序仅支持纵向模式,则可以通过执行以下操作来禁用此警告.

This is a kind of warning to inform developers that for big screen devices it is not good to restrict the orientation. However if your application only supports portrait mode then this warning can be disabled by doing the following.

Mac:Android Studio ->偏好

Mac: Android Studio -> Preferences

Windows: 文件 ->设置

那么:

  1. 搜索chrome"
  2. 取消选中活动被锁定到一个方向"
  3. 申请并确定.

这只会删除当前系统的警告.因此,此更改不会影响在同一项目上工作的其他用户.他们仍然会看到相同的警告.在某种程度上,当每个人都了解此警告时,最好对本地系统进行此更改.但是,如果我们想在项目级别删除此警告,则可以使用以下内容:在您的 Android 清单文件的清单标签中添加 tools:ignore="LockedOrientationActivity".例如

This will only remove the warning for the current system. So this change will not affect the other users working on the same project. They will still see the same warning. In a way, it is good to make this change for the local system as everyone gets to know about this warning. However, if we want to remove this warning at the project level then the following can be used: Add tools:ignore="LockedOrientationActivity" in the manifest tag of your Android Manifest file. For e.g.

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="LockedOrientationActivity"

所以这是您的个人偏好,无论您是希望每个开发人员都知道此警告,还是希望在清单中添加 tools:ignore="LockedOrientationActivity" 并将此警告静音每个人.我更愿意启发大家:)

So this is your personal preference, whether you want every developer to be aware of this warning or you want to add the tools:ignore="LockedOrientationActivity" in the manifest and mute this warning for everyone. I prefer to enlight everyone :)

这篇关于期待 'android:screenOrientation="unspecified"'或“全传感器"对于这项活动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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