[原創]Delphi XE 手機端實現沉浸式透明狀態欄
1、建立安卓工程后,在res/文件夾下創建一個目錄(values-v21),每個目錄中放一個style.xml
values-v21(這個數字根據自己的版本來):
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="AppTheme" parent="@android:style/Theme.NoTitleBar">
<item name="android:windowBackground">@drawable/splash_image</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTranslucentStatus">true</item> <!-- 為True就是狀態欄透明 滔Roy 2021.12.22 -->
<item name="android:windowTranslucentNavigation">false</item> <!-- 為True就是導航欄透明 滔Roy 2021.12.22 -->
<item name="android:statusBarColor">@android:color/transparent</item>
</style>
</resources>
2、將新建的兩個文件夾目錄中的style.xml加入到發布中(Deployment)
添加后,修改Remote Path
注意:如果編譯報錯,就重新打開加載程序。
創建時間:2021.12.22 更新時間: