在AndroidManifest中:期待android:screenOrientation ="unspecified" [英] In AndroidManifest: Expecting android:screenOrientation="unspecified"

查看:236
本文介绍了在AndroidManifest中:期待android:screenOrientation ="unspecified"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android Studio 3.6.

Android Studio 3.6.

我希望我的应用始终处于 portrait 模式.所以在我的 AndroidMainfest.xml 中:

I want my app to be always in portrait mode. So in my 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 模式显示.好的.但是编辑器显示以下错误:

I run the app and SplashActivity shows in portrait mode. Nice. But the editor shows the following error:

Expecting android:screenOrientation="unspecified"

为什么?

推荐答案

在清单标签中(位于 xmlns:android ="http://schemas.android.com/apk/res/android"下),放

In your manifest tag (just under xmlns:android="http://schemas.android.com/apk/res/android"), put

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

然后在应用程序标记内,放入

Then inside the application tag, put

tools:ignore="LockedOrientationActivity"

这篇关于在AndroidManifest中:期待android:screenOrientation ="unspecified"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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