主页 > 编程资料 > Delphi >
发布时间:2015-09-22 作者:网络 阅读:156次

Delphi XE5 为Android增加启动图片显示
本方法是根据群里重庆steve的“Android 启动不黑屏(可自定义启动屏)”整理的。
打开Project---Deployment添加:
1)Styles.xml,RemotePath设为:res\values\,Platfoms设为:Android
2)Loading.png ,RemotePath设为: res\drawable-port\(若是横屏的启动画面,设置为: res\drawable-land ),Platfoms设为:Android

打开AndroidManifest.template.xml

添加这段: android:theme="@style/MyTheme.NoTitleBar.CustomBackground"
编译运行就能看到启动图片。
已知问题:显示启动图片切换到程序界面时有短暂黑屏。

Styles.xml的内容:
<resources>
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<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>
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>

关键字词: