关于黑屏

默认的情况下,程序启动时,会有一个黑屏的时期,原因是,首个activity会加载一些数据,比如初始化列表数据等.

去除步骤

1./res/values/styles.xml 在 Theme 中,添加一个 android:windowBackgrounds 属性,设置需要的图片

2.在 AndroidManifest.xml 中设置Theme到首个启动的Activity下。

3.添加 /res/drawable-port/loading.png (若是横屏的启动画面,请放于 /res/drawable-land/loading.png )

4.完成

Code

<style name="MyTheme.NoTitleBar.CustomBackground" parent="@android:Theme.Black">          <item name="android:windowBackground">@drawable/loading</item>          <item name="android:windowNoTitle">true</item>          <item name="android:windowFullscreen">true</item>          <item name="android:windowContentOverlay">@null</item>   </style>
<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">                    <activity android:label="@string/app_name" android:theme="@style/MyTheme.NoTitleBar.CustomBackground"  android:configchanges="keyboardHidden|navigation|orientation" android:name="com.test.ui.MainActivity" android:screenorientation="portrait">            <intent-filter>                         <action android:name="android.intent.action.MAIN">                              <category android:name="android.intent.category.LAUNCHER">   </category>                      </action>         </intent-filter>   </activity>  ...  ...</application>

我是天王盖地虎的分割线

参考:http://blog.csdn.net/kepoon/article/details/6759724

更多相关文章

  1. Android(安卓)数据库 DB简单操作
  2. Android(安卓)studio使用zxing扫一扫
  3. android 在应用中安装其他程序
  4. Android_ActionBar
  5. Android(安卓)4.2 JellyBean Graphic Component -- SurfaceFling
  6. JNI中的本地方法添加调试信息
  7. android ListView常用知识总结
  8. android4.4 添加以太网ethernet方法
  9. Tensorflow:Android调用Tensorflow Mobile版本API(2)-基于Android的

随机推荐

  1. 排序算法 #1 选择排序(文字版)
  2. 一道 LeetCode 周赛的题目,让我自信满满!
  3. 每日前端夜话(0x03):2018年JavaScript状态
  4. 假期玩得开心也不忘充电,学习Python操作JS
  5. 使用Redis有哪些好处?
  6. 排序算法 #2 冒泡排序
  7. GlusterFs 启动报错,调试方法和处理
  8. FreeMarker 概述
  9. 有了Python,我能叫出所有猫的名字
  10. Android(安卓)Studio查看Android(安卓)5.