Skip to content

适配4.4以上版本的状态栏(颜色,内容布局延伸到状态栏)

License

Notifications You must be signed in to change notification settings

ghnor/StatusBarFits

Repository files navigation

StatusBarFits

适配4.4以上版本的状态栏(颜色,内容布局延伸到状态栏)

Gradle

compile 'com.ghnor:statusbarfits:1.1.0'

Maven

<dependency>
  <groupId>com.ghnor</groupId>
  <artifactId>statusbarfits</artifactId>
  <version>1.1.0</version>
  <type>pom</type>
</dependency>

用法

setContentView()方法之后调用:

setContentView(R.layout.main_activity);
...
StatusBarFits.setColor(activity);

如果布局是DrawerLayout,需要设置android:fitsSystemWindows="true"

示例

设置状态栏颜色

StatusBarFits.setColor();
设置状态栏颜色
DrawerLayout - close
DrawerLayout - open
Other

设置状态栏半透明或透明

StatusBarFits.setTranslucent();
StatusBarFits.setTransparent();
设置状态栏半透明
DrawerLayout - close
DrawerLayout - open
Other

Thanks

laobie/StatusBarUtil

About

适配4.4以上版本的状态栏(颜色,内容布局延伸到状态栏)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages