Since 4.4, Google has added a transparent status bar and navigation bar to Android, adding a small amount of code to it.
Add properties to the activity's layout file parent view:android:fitssystemwindows= "true " and android:cliptopadding= "true" .
<scrollview xmlns:android= "http://schemas.android.com/apk/res/android" xmlns:custom= "http// Schemas.android.com/apk/res-auto " android:layout_width=" match_parent " android:layout_height=" Match_ Parent " android:fitssystemwindows=" true " android:cliptopadding=" true " android:background=" # ffe5ff3e "> <linearlayout android:layout_width=" match_parent " android:layout_height=" Match_ Parent " android:orientation=" vertical "> <textview android:layout_width=" Match_parent " android:layout_height= "match_parent" android:padding= "16DP" android:textsize= "18SP" android:text= "@string/mytext"/> </LinearLayout></ScrollView>
If you don't want to Actionbar, you can get rid of it in androidmanifest.xml or activity. However, the transparency notification bar supports only more than 4.4 of the system, and the default notification bar is displayed below 4.4.
If you want to change the color of the notification bar, refer to the demo from GitHub Daniel:
Https://github.com/jgilfelt/SystemBarTint
The library has only one Systembartintmanager class that can be copied to its own project, so it doesn't have to rely on that library.
Imitation iOS transparent notification bar (only 4.4 or more versions supported)