Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Getting status bar height

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 203
    Comment on it

    Hello everyone ,

    I was working on status bar and found that we could get the height of the navigation bar at runtime.

    following is the code to get the height of the status bar.

    1. private int getStatusBarHeight() {
    2. int result = 0;
    3. int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
    4. if (resourceId > 0) {
    5. result = getResources().getDimensionPixelSize(resourceId);
    6. }
    7. return result;
    8. }

    Happy coding :)

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Reset Password
Fill out the form below and reset your password: