LoginSignup
1
1

More than 5 years have passed since last update.

GBでActionBarの高さを取得する

Posted at

ActionBarの高さはHoneyCome以降だとR.attr.actionBarSizeで取得できますがそれ未満だと0が返ってきます。
その場合supportライブラリの値から取得できます。

 if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    context.getTheme().resolveAttribute(android.support.v7.appcompat.R.attr.actionBarSize, tv, true)
    int actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data,getResources().getDisplayMetrics());
 }

今更使うことなさそうだけどね

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1