1.實現此style values-v19
<style name="TransalucaentStatusBar" parent="@style/Theme.AppCompat.Light.NoActionBar"> <!-- API 19 theme customizations can go here. --> <item name="android:windowTranslucentStatus">true</item> //取消狀態欄高度 <item name="android:windowTranslucentNavigation">true</item> <item name="android:windowNoTitle">true</item> </style>
2.在對應界面跟佈局fitsSystemWindows=false.
值爲false,可以將界面上拉,爲true,則界面在狀態欄下面顯示。