Does anyone know what is the default size of the TitleBar
and TitleBarText
in android?
Asked
Active
Viewed 4,665 times
4

Piolo Opaw
- 1,471
- 2
- 15
- 21
-
I think it can be vary depending upon the device – Linga Jan 21 '14 at 07:29
-
use hierarchyviewer and find it by yourself – pskink Jan 21 '14 at 07:31
2 Answers
3
You can find the default height here
The below is for 4.0.3
<dimen name="action_bar_default_height">48dip</dimen>
<dimen name="action_bar_title_text_size">18dp</dimen>
Check the dimens.xml under respective res/values folder
To the comments from Gopal Rao
<style name="TextAppearance">
<item name="android:textColor">?textColorPrimary</item>
<item name="android:textColorHighlight">?textColorHighlight</item>
<item name="android:textColorHint">?textColorHint</item>
<item name="android:textColorLink">?textColorLink</item>
<item name="android:textSize">16sp</item> // its is in sp not dp
<item name="android:textStyle">normal</item>
</style>
http://developer.android.com/guide/practices/screens_support.html
If you look at the topic best practices.
Quoting "you should prefer the sp (scale-independent pixel) to define text sizes. The sp scale factor depends on a user setting and the system scales the size the same as it does for dp".

Raghunandan
- 132,755
- 26
- 225
- 256
-
out of curiosity! Android says use `sp` as unit for text sizes but why this fellow using text size in `dp` (18dp)... – Gopal Gopi Jan 21 '14 at 07:46
-
@GopalRao i picked it from the link. you can check the source code from your sdk also. I am not sure why – Raghunandan Jan 21 '14 at 07:48
-
@GopalRao if you look @ http://developer.android.com/guide/practices/screens_support.html it says use `sp` . i thinks its for the tile text only the `dp` – Raghunandan Jan 21 '14 at 07:53