gpt4 book ai didi

Android 方向纵向布局仅不起作用

转载 作者:行者123 更新时间:2023-11-30 00:08:20 24 4
gpt4 key购买 nike

很抱歉这个百万次重复的回答,(我是 Andoid 的新手),但我无法实现仅在纵向方向上保持布局。我试过用推荐的方式设置它

android:screenOrientation="portrait"

Mainfest.xml 中(对于 Activity,(只有一个)),但它不起作用。谁知道为什么?

下面是我的AndroidManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.leo.vj">

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name_2"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
android:label="@string/app_name"
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />
</application>

</manifest>

最佳答案

看来你错误地声明了你的主要 Activity 。试试这个

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name_2"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity"
android:label="@string/app_name"
android:screenOrientation="portrait">

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

</activity>
<meta-data
android:name="preloaded_fonts"
android:resource="@array/preloaded_fonts" />

关于Android 方向纵向布局仅不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48595950/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com