Skip to content

Instantly share code, notes, and snippets.

@li2
Last active May 6, 2018 11:44
Show Gist options
  • Save li2/c5c73904850ff99db13a to your computer and use it in GitHub Desktop.
Save li2/c5c73904850ff99db13a to your computer and use it in GitHub Desktop.
实现背景半透明的 Android Activity?How to get appcompat translucent theme with support actionbar?通过修改 theme 的某些属性字段值来实现。 #tags: android-activity
<!--Refer to: http://stackoverflow.com/questions/20862258/android-how-to-get-appcompat-translucent-type-theme-with-support-actionbar-->
<!-- /res/values/styles.xml -->
<style name="Theme.AppCompat.Translucent">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item>
<item name="android:windowAnimationStyle">@android:style/Animation</item>
</style>
<!-- AndroidManifest.xml -->
<activity android:name=".TranslucentThemeActivity"
android:theme="@style/Theme.AppCompat.Translucent"/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment