Get ActionBarSherlock actionBarSize in Android 2.x

2019-03-19 12:55发布

问题:

I am using ActionBarSherlock, and this XML line crashes in Android 2.x:

android:layout_height="?android:attr/actionBarSize"

Is there a way to get the ActionBarSize for ABS? Something like this maybe:

?android:attr/actionBarSherlockSize

Thanks

回答1:

Use ?attr/actionBarSize which will work on all API levels.



回答2:

This did the trick:

android:layout_height="@dimen/abs__action_bar_default_height"