이 문서와 함께 Android 응용 프로그램 용 스플래시 화면을 만들려고합니다 : Splash Screens the Right Way. 기사에서 알 수 있듯이, 배경 비트 맵과 로고 (비트 맵)의 두 레이어로 LayerDrawable을 만들었습니다. 로고는 예를 들어 들여 쓰기 32dp와 함께 화면 하단에 위치해야합니다. 여기 내 당김은 :Android 반투명 상태 표시 줄이지만 반투명 탐색 모음 (있는 경우)
<item
android:drawable="@drawable/splash_image" />
<item
android:id="@+id/logo"
android:bottom="@dimen/margin_splash">
<bitmap
android:gravity="bottom|center"
android:src="@drawable/logo_green" />
</item>
나는 내 시작 활동 테마 android:windowBackground
PARAM으로이 당김을 지적했다. 또한이 기능이 지원되는 기기 (API> = 19)에 스플래시 화면이 표시되면 투명한 상태 표시 줄을 유지하기 위해 다양한 Android 버전 및 v19 \ styles.xml에 대한 두 개의 리소스 파일을 만들었습니다. 플래그는 android:windowTranslucentStatus
을 가리 킵니다. 사실. 여기 내 values/styles.xml
및 values-v19/styles.xml
:
값/styles.xml
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item>
</style>
</resources>
및
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="SplashTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/bg_splash</item>
<item name="android:windowTranslucentStatus">true</item>
</style>
</resources>
그러나 소프트 내비게이션 바 일부 안드로이드 장치에
값-V19/styles.xml 내 로고가 겹쳐져 있습니다.
android:windowTranslucentNavigation
플래그를 false로 지정했지만 성공하지 못했습니다.
감사합니다.