Skip to content

Instantly share code, notes, and snippets.

@shuanghua
Last active July 28, 2018 04:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shuanghua/9a4d4cc3f5b3d046421d90a3b9d2ea9c to your computer and use it in GitHub Desktop.
Save shuanghua/9a4d4cc3f5b3d046421d90a3b9d2ea9c to your computer and use it in GitHub Desktop.
方式1:
var resourceId = resources.getIdentifier("status_bar_height", "dimen", "android")
//修改高度
return resources.getDimensionPixelSize(resourceId)
方式2:
myView.setOnApplyWindwoInsetListener{view,insets ->
val statusBarSize = insets.systemWindowInsetTop
return insets
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment