</pre>由于我们用SwipeBackLayout需要将App的Theme添加一个透明的属性,这就是导致出现Bug的源头。<p></p><p> </p><pre name="code" class="html"> <application
android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
</application>
我们只需要单独将App的主界面设置成不透明就可以解决啦
code:
<activity
<span style="white-space:pre"> </span>android:name=".MainActivity"
android:theme="@style/AppThemeNotTranslucent" >
</activity>
style code:
<!-- Application theme. -->
<style name="AppTheme" parent="android:Theme.Holo.Light.NoActionBar">
<item name="android:windowIsTranslucent">true</item>
</style>
<!-- 单独为MainActivity设置不透明,解决SwipeBackLayout返回时显示桌面而不是上一层的Bug -->
<style name="AppThemeNotTranslucent" parent="android:Theme.Holo.Light.NoActionBar">
<item name="android:windowIsTranslucent">false</item>
</style>