Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@jungletian
Created August 11, 2017 03:45
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 jungletian/07920594cbf97a6f4a18f41afad0848d to your computer and use it in GitHub Desktop.
Save jungletian/07920594cbf97a6f4a18f41afad0848d to your computer and use it in GitHub Desktop.
the height of status bar
public static int getStatusBarHeight(Context context) {
int statusBarHeight = 0;
int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
if (resourceId > 0) {
statusBarHeight = context.getResources().getDimensionPixelSize(resourceId);
}
return statusBarHeight;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment