Android启动画面不会在横向显示,但对于仅纵向应用程序会显示纵向

问题描述

我正在制作一个肖像的android应用(sensorPortrait-用于人像和反肖像)

我的Activity1.cs文件是这样定义的,请注意screenorientation

    [Activity(Label = "@string/app_name",MainLauncher = true,Icon = "@mipmap/ic_launcher",Theme = "@style/Theme.Splash",AlwaysRetainTaskState = true,LaunchMode = LaunchMode.SingleInstance,Screenorientation = Screenorientation.UserPortrait,ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.Keyboard | ConfigChanges.KeyboardHidden | ConfigChanges.ScreenSize
    )]

我在res/drawable/splash_screen.xml中创建了一个基本的初始屏幕,res/values/styles.xml主题的值是这样定义的,请注意android:screenorientation

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="Theme.Splash" parent="android:Theme">
    <item name="android:windowBackground">@drawable/splash_screen</item>
    <item name="android:windowNoTitle">true</item>
    <item name="android:windowFullscreen">true</item>
    <item name="android:windowContentOverlay">@null</item>
    <item name="android:windowActionBar">true</item>
    <item name="android:screenorientation">fullUser</item>
  </style>
</resources>

场景(Nexus 9 API 27仿真器):

  • 当设备处于肖像 reversePortrait 模式并且我打开该应用程序时,启动屏幕出现,并转换为黑屏(无论出于何种原因)然后进入应用程序视图

  • 当设备处于 landscape reverseLandscape 模式下并且我打开该应用程序时,没有出现初始屏幕,而是该应用程序转换为黑屏,然后转换为应用程序视图(同时还使应用程序/屏幕的旋转动画化为纵向模式)

当从所有屏幕方向启动应用程序时,如何使启动屏幕出现? (初始屏幕的方向无关紧要,但最好是纵向)

我尝试将android:screenorientation属性更新为other values,但没有运气。我应该创建其他res/values-land/styles.xml / res/values-port/styles.xml文件吗?

是否还可以做到,使应用程序从启动屏幕直接进入应用程序视图? (之间没有加载黑屏吗?)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)