SoFunction
Updated on 2025-03-11

How to configure android horizontal and vertical screen restrictions

In developing Android applications, sometimes it is necessary to limit horizontal and vertical screen switching. Just add the android:screenOrientation attribute limitation in the file.
ndroid:screenOrientation="landscape" is to restrict the horizontal display of this page.
ndroid:screenOrientation="portrait" is to limit the number of pages to display in a vertical screen.
For example: I now want all pages to be displayed vertically no matter what, then mine should write this:
Copy the codeThe code is as follows:

/apk/res/Android"
     < package=""
      android:versionCode="1"
      android:versionName="1.0">

                          <android:label="@string/app_name"
                  android:screenOrientation="portrait">