- 只需要在 'styles.xml' 写一个
style
就行了
<style name="TranslucentTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowNoTitle">true</item>
<item name="android:windowBackground">#60000000</item>
<item name="android:windowIsTranslucent">true</item>
</style>
- 然后在你的
AndroidManifest.xml
给需要设置透明主题的Activity
设置theme
就可以了
当用户打开新的
Activity
为透明主题时 那么当前Activity
不会回调onStop()