Created
August 24, 2014 12:15
-
-
Save XinyueZ/63db20f537ed24673949 to your computer and use it in GitHub Desktop.
Get ActionBar's height.
This file contains hidden or 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
| /* Get ActionBar's height. */ | |
| int[] abSzAttr; | |
| if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { | |
| abSzAttr = new int[]{android.R.attr.actionBarSize}; | |
| } else { | |
| abSzAttr = new int[]{R.attr.actionBarSize}; | |
| } | |
| TypedArray a = obtainStyledAttributes(abSzAttr); | |
| mActionBarHeight = a.getDimensionPixelSize(0, -1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment