透明背景Activity设置

xiaoxiao2021-02-27  643

1.添加Style

<style name="myTransparent"> <item name="android:windowBackground">@color/transparent</item> <item name="android:windowNoTitle">true</item> <item name="android:windowIsTranslucent">true</item> <item name="android:windowAnimationStyle">@android:style/Animation.Translucent</item> </style>

2.在AndroidManifest中套用该Style

<activity android:name=".SearchActivity" android:windowSoftInputMode="adjustResize" android:launchMode="singleTask" android:screenOrientation="portrait" android:theme="@style/myTransparent"> </activity>
转载请注明原文地址: https://www.6miu.com/read-1163.html

最新回复(0)