Created
May 11, 2015 13:00
-
-
Save lon9/492d797cc4a981f8c832 to your computer and use it in GitHub Desktop.
Statusbarのサイズ(高さ)を取得する。 ref: http://qiita.com/Rompei/items/4f83ab38f416b60897cb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Return Statusbar size. | |
* @param activity Activity | |
* @return Statusbar size | |
*/ | |
public static int getStatusBarHeight(Activity activity){ | |
final Rect rect = new Rect(); | |
Window window = activity.getWindow(); | |
window.getDecorView().getWindowVisibleDisplayFrame(rect); | |
return rect.top; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment