android - 在 AndroidManifest : Expecting android:screenOrientation ="unspecified"

标签 android android-manifest screen-orientation

安卓工作室 3.6。

我希望我的应用程序始终在 portrait 中模式。所以在我的AndroidMainfest.xml :

<activity
   android:name=".activity.SplashActivity"
   android:screenOrientation="portrait">
   <intent-filter>
      <action android:name="android.intent.action.MAIN" />

      <category android:name="android.intent.category.LAUNCHER" />
   </intent-filter>
</activity>

我运行应用程序和SplashActivity显示在 portrait模式。好的。
但是编辑器显示以下错误:

Expecting android:screenOrientation="unspecified"

为什么?

最佳答案

在您的 list 标签中(在 xmlns:android="http://schemas.android.com/apk/res/android" 下方),输入

xmlns:tools="http://schemas.android.com/tools"

然后在应用程序标签内,放
tools:ignore="LockedOrientationActivity"

关于android - 在 AndroidManifest : Expecting android:screenOrientation ="unspecified",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58519021/

相关文章:

android - 我设置了uses-feature android :required ="false" but Google play keeps insisting on these features

android - 使用 Phonegap 旋转 Android 设备时崩溃

android - 如何以编程方式连接到 Android 中的 VPN 服务器(用户名和密码)

Android后台线程管理和Activity生命周期

android - Moshi 在 Kotlin 惰性属性上失败

java - 重构包名破坏了整个应用程序

android - 不可分配给 'android.app.activity' 扩展应用程序

android - 使用参数 {NDK_PROJECT_PATH=null 执行进程 .../ndk-bundle/ndk-build 时出错

java - Android ActivityGroup 屏幕方向

android - 如何在屏幕方向更换后恢复 fragment