How to get the Size of android notification bar?

public int getStatusBarHeight() {
      int result = 0;
      int resourceId = getResources().getIdentifier("status_bar_height", "dimen", "android");
      if (resourceId > 0) {
          result = getResources().getDimensionPixelSize(resourceId);
      }
      return result
}

this method worked fine for me.

[Reference]

http://stackoverflow.com/questions/3407256/height-of-status-bar-in-android

http://stackoverflow.com/questions/2485697/getting-the-size-of-the-window-without-title-notification-bars

posted @ 2013-06-21 00:20  CY.  阅读(286)  评论(0编辑  收藏  举报