有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何将应用程序锁定到环境中

我知道还有两篇类似的帖子,听我说,我已经尝试了他们的代码,但我无法让我的应用程序锁定到横向模式

我在Java清单中输入了屏幕方向,但仍然没有输入任何内容。这是密码

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:安卓="http://schemas.安卓.com/apk/res/安卓"
package="com.anthonypalmer.tappydefender">
<application
    安卓:allowBackup="true"
    安卓:icon="@mipmap/ic_launcher"
    安卓:label="@string/app_name"
    安卓:supportsRtl="true"
    安卓:theme="@style/AppTheme">
    <activity 安卓:name=".MainActivity">
        安卓:theme="@安卓:style/Theme.NoTitleBar.Fullscreen"
        安卓:screenOrientation="landscape"
        <intent-filter>
            <action 安卓:name="安卓.intent.action.MAIN" />
            <category 安卓:name="安卓.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <!--
    ATTENTION: This was auto-generated to add Google Play services to your project for
    App Indexing.  See https://g.co/AppIndexing/AndroidStudio for more information.
    -->
    <meta-data
        安卓:name="com.google.安卓.gms.version"
        安卓:value="@integer/google_play_services_version" />

共 (1) 个答案

  1. # 1 楼答案

    你把你的装束放错地方了android:theme和{}是{}部分{}的“邻居”:

     <activity
            android:name=".MainActivity"
            android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
            android:screenOrientation="landscape">