0

Sorry guys. I am new ish to using android studio. I was wondering if it is possible to set the layout height of the toolbar to

?attr/actionBarSize + 15px

Thanks in advance

android:layout_height="?attr/actionBarSize+15px"

Does not work for me. Thanks again

Ddude
  • 59
  • 1
  • 2
  • 6
  • Possible duplicate of [What is the difference between "px", "dp", "dip" and "sp" on Android?](http://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dp-dip-and-sp-on-android) – OBX Oct 18 '16 at 18:02
  • possible duplicate [How to change action bar size](http://stackoverflow.com/questions/17439683/how-to-change-action-bar-size) – HelloSadness Oct 18 '16 at 18:03

1 Answers1

2

No. It is not possible to setup in XML like that. For that you need to do it in Java.

For that you do the method shown on the following question to get the actionBarSize valued https://stackoverflow.com/a/13216807/906362

and then set it to the view you want with:

view.getLayoutParams().height = actionBarHeight + 15;
Community
  • 1
  • 1
Budius
  • 39,391
  • 16
  • 102
  • 144