scrim으로 사용되는 그래디언트입니다. 이 효과를 얻으려면 먼저 상태 및 탐색 막대의 반투명 언더 레이를 제거해야합니다. Another answer 하위 플랫폼 장치에서이 작업을 수행하는 방법에 대해 자세히 설명합니다. 하지만 안드로이드 롤리팝 이상에, 당신은 단순히 두 가지 스타일을 설정하여이 작업을 수행 할 수 있습니다 투명 속성을 : 당신이 그런
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient android:type="linear"
android:angle="270"
android:centerY="0.3"
android:startColor="#66000000"
android:centerColor="#33000000"
android:endColor="#00000000"/>
</shape>
:
다음
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="Theme" parent="android:Theme.Material.Wallpaper.NoTitleBar">
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
</style>
</resources>
에서, 스크림을 추가, 당신은 드로어 블 모양을 사용할 수 있습니다 또한 일의 바닥에 동일한 기울기를 사용하도록 android:rotation="180"
속성을 설정할 수 있습니다
<View
android:layout_width="match_parent"
android:layout_height="72dp"
android:background="@drawable/scrim"/>
: 당신의 레이아웃에 View
의 배경으로 이것을 설정할 수 있습니다 전자 스크린.
는, 당신이 –
당신이 '의 minSdkVersion'또는 'targetSdkVersion을 언급하는 오래된 OS 옵션을 추가해야 것을 '?? .... 나는 안드로이드 6.0 장치에서 테스트 중이 야, 구글 스크린 샷은 또한 같은 장치에서 가져온 것입니다 ... 나는 21로, 그리고 targetSdkVersion 23로 minSdkVersion 내 샘플 애플 리케이션에 언급했습니다 –