轉載地址:http://blog.csdn.net/leebe/article/details/44750959
- </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>