最近为了实现自己项目中的沉浸式状态栏,就研究了一下,如果有不对的地方望请指教
下面会介绍两种沉浸式状态栏的实现方法,因为这种样式是从android4.4才开始出现的,我也只是是配到 4.4以上。
第一种:兼容4.4及以上
第一步:在style中设置theme,应用到application 或者但一个activity中
<style name="single" parent="Theme.AppCompat.Light.DarkActionBar"><!-- parent="@android:style/Theme" --> <item name="android:windowTranslucentStatus" tools:targetApi="kitkat">true</item> <!--<item name="android:windowTranslucentNavigation" tools:targetApi="ki