Piolo Opaw
Piolo Opaw

Reputation: 1511

what is the default height of TitleBar and default TextSize in Titlebar in android?

Does anyone know what is the default size of the TitleBar and TitleBarText in android?

Upvotes: 4

Views: 4708

Answers (2)

Raghunandan
Raghunandan

Reputation: 133560

You can find the default height here

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/frameworks/base/core/res/res/values/dimens.xml

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

http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.0.3_r1/frameworks/base/core/res/res/values/styles.xml?av=f

<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".

Upvotes: 3

Linga
Linga

Reputation: 10563

It can be vary depending upon the device. here is the list of all devices with size

Upvotes: 0

Related Questions