很简单,只需要在Manifest.xml中为Activity添加一个theme即可。
如 :
效果图
如 :
</span><activity
android:name="cn.com.android.SearchDestinationActivity"
android:theme="@style/translucent"
android:screenOrientation="portrait"
android:windowSoftInputMode="stateVisible|adjustPan">
</activity>
而对于style的定义可以参考如下:
<!-- 半透明无titlebar activity样式 -->
<style name="translucent" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowBackground">@color/half_transparent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
对于style中color的定义:
<color name="half_transparent">#a0000000</color>
效果图