我的背景图像是PNG 375 × 667
请注意,我是而不是,在活动的onCreate()中使用setContentView()
我纯粹是在利用一个主题
使用正常的活动布局,用户将在第一次启动应用程序==> 而不是我想要的之前,看到一个空白的暗屏幕2-3秒,然后才能看到Splash屏幕图像。
当用户打开应用程序时,我需要Splash屏幕图像立即显示出来。
有些人让Splash屏幕变得透明,这意味着用户将在2-3秒内看到任何事情,这是我第一次看到==> 不可接受的。
Manifest.xml
<activity
android:name=".views.activities.SplashActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:launchMode="singleInstance"
android:screenOrientation="portrait"
android:theme="@style/SplashTheme"
android:windowSoftInputMode="stateAlwaysHidden|adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>styles.xml
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowActionBar">false</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowIsTranslucent">false</item>
<item name="android:background">@drawable/bg_splash</item>
</style>bg_splash.xml
<item
android:drawable="@android:color/black"/>
<item
android:drawable="@drawable/splash_full_tiny"
android:gravity="center">
</item>
这种情况只发生在几个设备上:
发布于 2016-12-15 03:20:02
尝试添加此android:largeHeap="true“
<application
android:allowBackup="true"
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:largeHeap="true"
></application>发布于 2016-12-15 05:25:52
尝试在应用程序标记中应用splashtheme样式,或者可以向appTheme添加与SplashTheme相同的背景。这将显示您的飞溅图像快速。确保一旦执行,检查所有活动。因为它将用作应用程序中的后台。在所有具有透明背景的活动中,它将显示为背景。我希望这能帮到你。
发布于 2016-12-15 03:27:18
为此,您应该对不同的设备或任何小图像使用不同的图像。
https://stackoverflow.com/questions/41155517
复制相似问题