Can I set FLAG_LAYOUT_NO_LIMITS only for status bar?

前端 未结 13 1572
旧时难觅i
旧时难觅i 2020-12-23 13:32

I need to make transparent status bar. I am using getWindow().addFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS) and it is make status bar as I want. Bu

相关标签:
13条回答
  • 2020-12-23 14:03

    yes , You can use this code in Style.xml

    <style name="transparent" parent="Theme.AppCompat.Light">//AppCompat is the key; You can choose any other theme than the light-theme, but stick to AppCompat
    
        <item name="colorPrimaryDark">#00000000</item>//THIS is the important part.
        //Other styling(optional)
    </style>
    

    Then to apply it to your layout, simply add the following line in the root layout(view):

    android:theme="@style/transparent"
    
    0 讨论(0)
提交回复
热议问题