解决方法一:

使用透明主题

点击项目 -> 在 构建设置 里面找到 Build Android APK 栏目,点击 create templates 创建一个 AndroidManifest.xml

<?xml version="1.0"?>
<manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
<application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --">
<activity
android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
android:name="org.qtproject.qt5.android.bindings.QtActivity"
android:label="-- %%INSERT_APP_NAME%% --"
android:screenOrientation="unspecified"
android:launchMode="singleTop"
android:theme="@android:style/Theme.Translucent.NoTitleBar"
<!-- 添加上面一条即可,只是把黑屏设置成透明的而已,启动还是会慢 -->
<!-- @android:style/Theme.Translucent -->
<!-- @android:style/Theme.Translucent.NoTitleBar -->
<!-- @android:style/Theme.Translucent.NoTitleBar.Fullscreen -->
> <intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter> <!-- Application arguments -->
<!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
<!-- Application arguments --> <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
<meta-data android:name="android.app.repository" android:value="default"/>
<meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
<meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
<!-- Deploy Qt libs as part of package -->
<meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
<meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
<!-- Run with local libs -->
<meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
<meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
<meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
<meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
<meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
<!-- Messages maps -->
<meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
<meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
<meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
<!-- Messages maps --> <!-- Splash screen -->
<!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
<!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
<!-- Splash screen --> <!-- Background running -->
<!-- Warning: changing this value to true may cause unexpected crashes if the
application still try to draw after
"applicationStateChanged(Qt::ApplicationSuspended)"
signal is sent! -->
<meta-data android:name="android.app.background_running" android:value="false"/>
<!-- Background running --> <!-- auto screen scale factor -->
<meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
<!-- auto screen scale factor --> <!-- extract android style -->
<!-- available android:values :
* full - useful QWidget & Quick Controls 1 apps
* minimal - useful for Quick Controls 2 apps, it is much faster than "full"
* none - useful for apps that don't use any of the above Qt modules
-->
<meta-data android:name="android.app.extract_android_style" android:value="full"/>
<!-- extract android style -->
</activity> <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices --> </application> <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
<supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
Remove the comment if you do not require these default permissions. -->
<!-- %%INSERT_PERMISSIONS --> <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
Remove the comment if you do not require these default features. -->
<!-- %%INSERT_FEATURES --> </manifest>
解决方法二:

使用图片替换主题

在res/values文件目录下新建一个 style.xml 文件,文件内容如下
<?xml version='1.0' encoding='utf-8'?>
<resources>
<style name="Theme.AppStartLoad" parent="android:Theme">
<item name="android:windowBackground">@drawable/logo</item>
<!-- @drawable/logo 确保 android\res\drawable-hdpi\logo.png 存在 -->
<item name="android:windowNoTitle">true</item>
</style>
<style name="Theme.AppStartLoadTranslucent" parent="android:Theme">
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowNoTitle">true</item>
</style>
</resources> 然后在 AndroidManifest.xml 中应用上面定义的两个主题,添加的位置如下
<application android:theme = "@style/Theme.AppStartLoadTranslucent">
<activity android:theme="@style/Theme.AppStartLoad"> <!-- Splash screen -->
<!-- <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> -->
<!-- <meta-data android:name="android.app.splash_screen_sticky" android:value="true"/> -->
<!-- Splash screen -->
//这上面的是添加启动图片
解决方案三
https://falsinsoft.blogspot.com/2017/07/qml-show-android-native-splash-screen.html

Qt for Android 启动短暂的黑屏或白屏问题如何解决?的更多相关文章

  1. Android 跨进程启动Activity黑屏(白屏)的三种解决方案

    原文链接:http://www.cnblogs.com/feidu/p/8057012.html 当Android跨进程启动Activity时,过程界面很黑屏(白屏)短暂时间(几百毫秒?).当然从桌面 ...

  2. Android 启动APP时黑屏白屏的三个解决方案

    你会很奇怪,为什么有些app启动时,会出现一会儿的黑屏或者白屏才进入Activity的界面显示,但是有些app却不会如QQ手机端,的确这里要做处理一下.这里先了解一下为什么会出现这样的现象,其实很简单 ...

  3. Android 启动APP时黑屏白屏的三个解决方案(转载)

    你会很奇怪,为什么有些app启动时,会出现一会儿的黑屏或者白屏才进入Activity的界面显示,但是有些app却不会如QQ手机端,的确这里要做处理一下.这里先了解一下为什么会出现这样的现象,其实很简单 ...

  4. 前端性能优化——首屏时间&&白屏时间

    1.首屏时间概念 首屏时间是指用户打开一个网站时,直到浏览器首页面内容渲染完成的时间. 2.白屏时间概念 白屏时间即是,浏览器开始显示内容的时间,所以我们一般认为解析完<head>的时刻, ...

  5. Android 启动APP时黑屏白屏的解决方案

    在开发中,我们在启动app的时候,屏幕会出现一段时间的白屏或者黑屏,不同设备时间长短不同.很影响用户体验. 首先分析一下,产生这个现象的原因,当我们在启动一个应用时,系统会去检查是否已经存在这样一个进 ...

  6. android启动第一个界面时即闪屏的核心代码(两种方式)

    闪屏,就是SplashScreen,也能够说是启动画面,就是启动的时候,闪(展示)一下,持续数秒后.自己主动关闭.  第一种方式: android的实现很easy,使用Handler对象的postDe ...

  7. Android启动时闪一下黑屏或者白屏

    1.设定主题,此主题为透明的,加入到res/values/styles.xml中: <style name="Theme.AppStartLoadTranslucent" p ...

  8. JQuery Mobile - 解决切换页面时,闪屏,白屏等问题

    在点击链接,切换页面时候,总是闪屏,感觉很别扭,看起来不舒服,怎么解决这个问题?方法很简单,就是在每个页面的meta标签内定义user-scalable的属性为 no! <meta name=& ...

  9. 解决android 启动白屏问题

    Android 启动APP时黑屏白屏的三个解决方案 http://www.cnblogs.com/liqw/p/4263418.html android:windowSoftInputMode属性使用 ...

随机推荐

  1. WebUI中 DataGrid多层表头 的终极解决办法

    因为DataGrid控件的简单易懂,大多数做.NET程序员都喜欢用,有需要把数据显示成表格样式的地方DataGrid会是首选,但是所有的东西都会有好和不好的一面,DataGrid在给我们带来了数据显示 ...

  2. 通过WSDL命令,将WSDL生成代理类

    VS2010 打开命令行窗口(开始-VS2010--Visual Studio Tools--Visual Studio Command Prompt) 输入: wsdl  /l:cs /n:newN ...

  3. 345. Reverse Vowels of a String【easy】

    345. Reverse Vowels of a String[easy] Write a function that takes a string as input and reverse only ...

  4. grub.conf文件说明

    default=0 timeout=5 splashimage=(hd0,0)/grub/splash.xpm.gz hiddenmenu title Red Hat Enterprise Linux ...

  5. Python内置函数之exec()

    exec(object[,gobals[,locals]])这个函数和eval()有相同的作用,用来做运算的. 区别是,exec()可以直接将运算结果赋值给变量对象,而eval()只能运算不能赋值. ...

  6. Django中API分析

    下面,我将仔细分析一次请求的旅程: web端发出一个请求报文,到获得服务器的响应报文结束. 1.打开浏览器,输入URL,进入API页面: http://127.0.0.1:8000/api/salt ...

  7. 李洪强iOS开发之OC[007] - 李洪强iOS开发之类的声明和实现

    类的声明和实现 类是一类具有相同特征和共同行为的集合 小轿车   大卡车   挖掘机    (车) 车类 类名: Car 属性: 颜色  速度  轮字数 共同行为: 跑  停  载人 对象: 是类的具 ...

  8. vue 深入响应式原理

    vue最显著的特性就是不太引人注意的响应式系统(reactivity system),模型层(model)只是普通的javascript对象,修改它则更新视图view.这会让状态管理变得非常简单且直观 ...

  9. libubox组件(2)——blob/blobmsg (转载 https://segmentfault.com/a/1190000002391970)

    一:blob相关接口 1.数据结构 1: struct blob_attr { 2: uint32_t id_len; /** 高1位为extend标志,高7位存储id, 3: * 低24位存储dat ...

  10. IOS设计模式浅析之外观模式(Facade)

    引言 在项目开发中,有时候会遇到这样的一种情景:已有系统的各个子系统之间,随着业务需求的发展,有了比较紧凑的耦合关系.现在需要利用这些子系统的功能,为移动端提供业务处理.我们该怎么应对这样的业务需求呢 ...