解决方法一:

使用透明主题

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

  1. <?xml version="1.0"?>
  2. <manifest package="org.qtproject.example" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="1.0" android:versionCode="1" android:installLocation="auto">
  3. <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --">
  4. <activity
  5. android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation"
  6. android:name="org.qtproject.qt5.android.bindings.QtActivity"
  7. android:label="-- %%INSERT_APP_NAME%% --"
  8. android:screenOrientation="unspecified"
  9. android:launchMode="singleTop"
  10. android:theme="@android:style/Theme.Translucent.NoTitleBar"
  11. <!-- 添加上面一条即可,只是把黑屏设置成透明的而已,启动还是会慢 -->
  12. <!-- @android:style/Theme.Translucent -->
  13. <!-- @android:style/Theme.Translucent.NoTitleBar -->
  14. <!-- @android:style/Theme.Translucent.NoTitleBar.Fullscreen -->
  15. >
  16. <intent-filter>
  17. <action android:name="android.intent.action.MAIN"/>
  18. <category android:name="android.intent.category.LAUNCHER"/>
  19. </intent-filter>
  20. <!-- Application arguments -->
  21. <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ -->
  22. <!-- Application arguments -->
  23. <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
  24. <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/>
  25. <meta-data android:name="android.app.repository" android:value="default"/>
  26. <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/>
  27. <meta-data android:name="android.app.bundled_libs_resource_id" android:resource="@array/bundled_libs"/>
  28. <!-- Deploy Qt libs as part of package -->
  29. <meta-data android:name="android.app.bundle_local_qt_libs" android:value="-- %%BUNDLE_LOCAL_QT_LIBS%% --"/>
  30. <meta-data android:name="android.app.bundled_in_lib_resource_id" android:resource="@array/bundled_in_lib"/>
  31. <meta-data android:name="android.app.bundled_in_assets_resource_id" android:resource="@array/bundled_in_assets"/>
  32. <!-- Run with local libs -->
  33. <meta-data android:name="android.app.use_local_qt_libs" android:value="-- %%USE_LOCAL_QT_LIBS%% --"/>
  34. <meta-data android:name="android.app.libs_prefix" android:value="/data/local/tmp/qt/"/>
  35. <meta-data android:name="android.app.load_local_libs" android:value="-- %%INSERT_LOCAL_LIBS%% --"/>
  36. <meta-data android:name="android.app.load_local_jars" android:value="-- %%INSERT_LOCAL_JARS%% --"/>
  37. <meta-data android:name="android.app.static_init_classes" android:value="-- %%INSERT_INIT_CLASSES%% --"/>
  38. <!-- Messages maps -->
  39. <meta-data android:value="@string/ministro_not_found_msg" android:name="android.app.ministro_not_found_msg"/>
  40. <meta-data android:value="@string/ministro_needed_msg" android:name="android.app.ministro_needed_msg"/>
  41. <meta-data android:value="@string/fatal_error_msg" android:name="android.app.fatal_error_msg"/>
  42. <!-- Messages maps -->
  43. <!-- Splash screen -->
  44. <!-- meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/ -->
  45. <!-- meta-data android:name="android.app.splash_screen_sticky" android:value="true"/ -->
  46. <!-- Splash screen -->
  47. <!-- Background running -->
  48. <!-- Warning: changing this value to true may cause unexpected crashes if the
  49. application still try to draw after
  50. "applicationStateChanged(Qt::ApplicationSuspended)"
  51. signal is sent! -->
  52. <meta-data android:name="android.app.background_running" android:value="false"/>
  53. <!-- Background running -->
  54. <!-- auto screen scale factor -->
  55. <meta-data android:name="android.app.auto_screen_scale_factor" android:value="false"/>
  56. <!-- auto screen scale factor -->
  57. <!-- extract android style -->
  58. <!-- available android:values :
  59. * full - useful QWidget & Quick Controls 1 apps
  60. * minimal - useful for Quick Controls 2 apps, it is much faster than "full"
  61. * none - useful for apps that don't use any of the above Qt modules
  62. -->
  63. <meta-data android:name="android.app.extract_android_style" android:value="full"/>
  64. <!-- extract android style -->
  65. </activity>
  66. <!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
  67. </application>
  68. <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/>
  69. <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/>
  70. <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application.
  71. Remove the comment if you do not require these default permissions. -->
  72. <!-- %%INSERT_PERMISSIONS -->
  73. <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application.
  74. Remove the comment if you do not require these default features. -->
  75. <!-- %%INSERT_FEATURES -->
  76. </manifest>
解决方法二:

使用图片替换主题

  1. res/values文件目录下新建一个 style.xml 文件,文件内容如下
  2. <?xml version='1.0' encoding='utf-8'?>
  3. <resources>
  4. <style name="Theme.AppStartLoad" parent="android:Theme">
  5. <item name="android:windowBackground">@drawable/logo</item>
  6. <!-- @drawable/logo 确保 android\res\drawable-hdpi\logo.png 存在 -->
  7. <item name="android:windowNoTitle">true</item>
  8. </style>
  9. <style name="Theme.AppStartLoadTranslucent" parent="android:Theme">
  10. <item name="android:windowIsTranslucent">true</item>
  11. <item name="android:windowNoTitle">true</item>
  12. </style>
  13. </resources>
  14. 然后在 AndroidManifest.xml 中应用上面定义的两个主题,添加的位置如下
  15. <application android:theme = "@style/Theme.AppStartLoadTranslucent">
  16. <activity android:theme="@style/Theme.AppStartLoad">
  17. <!-- Splash screen -->
  18. <!-- <meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/logo"/> -->
  19. <!-- <meta-data android:name="android.app.splash_screen_sticky" android:value="true"/> -->
  20. <!-- Splash screen -->
  21. //这上面的是添加启动图片
解决方案三
  1. 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. MATLAB 的日期和时间

    MATLAB的日期和时间常用函数 函数 说明 calender 返回日历 clock 当前时间 date 当前日期 weekday 星期几 now 当前的日期和时间 datevec 以向量显示日期 d ...

  2. Android 关于ZXing的使用

    1.http://blog.csdn.net/ryantang03/article/details/7831826 2.http://blog.csdn.net/xiaanming/article/d ...

  3. 【转】SQL SERVER获取索引脚本

    关于如何获取索引脚本的语句很多,上次在项目中需要去查询并获取索引脚本,所以写了一个简单的查询语句来进行获取. WITH    idxcol          AS ( SELECT           ...

  4. 最小生成树之Kruskal算法和Prim算法

    依据图的深度优先遍历和广度优先遍历,能够用最少的边连接全部的顶点,并且不会形成回路. 这样的连接全部顶点并且路径唯一的树型结构称为生成树或扩展树.实际中.希望产生的生成树的全部边的权值和最小,称之为最 ...

  5. 使用 ObjectDataSource 缓存数据

    简介 就计算机科学而言 , 缓存 过程包括成本昂贵的数据或信息的获取 , 以及将备份存储在可快速访问的位置.对于数据驱动的应用程序,大型.复杂的查询通常会消耗大量应用程序执行时间.要提升这类应用程序的 ...

  6. Java_MD5的使用

    在Java中使用MD5摘要还是很方便的,直接上代码. package com.cxc.nothing; import java.nio.charset.Charset; import java.sec ...

  7. python如何连接mysql数据库

    先花点时间来说说一个程序怎么和数据库进行交互1.和数据库建立连接2.执行sql语句,接收返回值3.关闭数据库连接使用MySQLdb也要遵循上面的几步.让我们一步步的进行. 1.MySQL数据库要用My ...

  8. php 批量处理post数据

    <?php header("Content-Type:text/html;charset=UTF-8"); include('ini.php'); foreach ($_PO ...

  9. Theano mnist数据集格式

    首先链接一篇大牛的Theano文档翻译:http://www.cnblogs.com/xueliangliu/archive/2013/04/03/2997437.html 里面有mnist.pkl. ...

  10. 用MathType可以编辑n元乘积吗

    在学习数学过程中很多的用户朋友会发现需要接触到各种数学符号.但是在编辑文档的时候很多的文档自带的符号往往不够全面,这个时候就需要专业的数学公式编辑器来解决这个问题.MathType就是在这种情况下诞生 ...