0
目前,我使用下面的主題在我的活動如何保持windowTranslucentStatus,但能「推」和「調整大小」對話框啓動片段
<style name="Theme.JStock.Toolbar.Transparent.Light" parent="@style/Theme.JStock.Base.Light">
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowContentOverlay">@null</item>
</style>
我用windowTranslucentStatus
,因爲我想要的狀態欄「跟隨」我的工具欄的顏色。我的工具欄的顏色動態改變。
然而,這也創造了一個不想要的副作用。
當我從活動啓動對話片段,該對話框不能「推」和「調整大小」
如果我刪除windowTranslucentStatus
,並改變我的活動主題,以
<style name="Theme.JStock.Toolbar.Transparent.Light" parent="@style/Theme.JStock.Base.Light">
<!--<item name="android:windowTranslucentStatus">true</item>-->
<item name="android:windowContentOverlay">@null</item>
</style>
對話框將按預期「推高」和「調整大小」。
不過,我不希望刪除windowTranslucentStatus
無論是。我想要狀態欄與工具欄動態顏色具有相同的顏色。正如您在刪除windowTranslucentStatus
後看到的那樣,狀態欄變成黑色。
我可以知道,我怎麼可能保持windowTranslucentStatus
,但能夠「推高」和「調整大小」啓動的對話框片段?
如果設置半透明狀態,以對話的主題? –
@BrunoFerreira謝謝。有用。你想添加它作爲答案,以便我可以接受它嗎? –
是的,我添加一個答案來幫助其他人:) –