【发布时间】:2017-04-27 22:27:27
【问题描述】:
最后编辑
我试图在this guideline 之后实现 SplashScreen。所以我设置了一个带有图层列表并使用图标的drawable,但是图标太大了,所以我制作了一个更小的新文件。结果从未出现在我的应用程序中:我制作的第一个可绘制对象总是出现,从不更新。
- 我重命名了图片文件,drawable
- 我将样式重命名为 在清单中使用
- 我清理了项目
- 我重建了项目
- 我 同步
- 我使用了无效缓存/重启选项
- 我更新了 安卓工作室
- 我移动了我的项目文件夹,创建了一个新文件夹并 只复制粘贴了 java 和 xml 文件,因为我认为 缓存文件将被删除
Nada,当我在手机上部署 apk 时,总是显示旧的 drawable。 这是什么,哪个工艺?我错过了什么?我在哪里可以找到缓存?我找了一个 bin 文件夹,我在一些论坛上看到我应该删除它,但它不在我的工作区中。
我在下面发布我的代码:
AndroidManifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="lu.intech.mcfc">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity
android:name=".activity.InitActivity"
android:theme="@style/SplashTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".activity.LoginActivity" />
</application>
</manifest>
styles.xml:
<resources>
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
</style>
<style name="SplashTheme" parent="Theme.AppCompat.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
</style>
</resources>
splash_screen.xml:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:drawable="@color/colorPrimary"/>
<item>
<bitmap
android:gravity="center"
android:src="@drawable/logo_wega_100x31"/>
</item>
</layer-list>
编辑 我确实在另一部手机上尝试了我的应用程序,它立即按预期工作。所以我猜问题出在电话上。即使我每次再次测试时都卸载了该应用程序,但仍会显示旧的可绘制对象。除了卸载应用,我还能做些什么来清理手机上的缓存?
【问题讨论】:
-
你尝试改变drawable/splash_screen
-
尝试卸载应用并重新安装
-
我都做了,请看我的编辑。
标签: android