11

How to increase the size of the title bar attached to the top of any screen in android

2 Answers 2

28

EDIT:

this solution was for API < 11 ... now we have ActionBars

EDIT: first i answer this

Create custom titlebar in Android

EDIT: I'm adding this because I think Sujit gave the wrong answer.

To increase the size of the title bar you will need to add file with this content to res/values

<?xml version="1.0" encoding="utf-8"?>
<resources>
    <style name="CustomTheme" parent="android:Theme">
        <item name="android:windowTitleSize">50dip</item>
    </style>
</resources>

in AndroidManifest.xml file

        <activity android:theme="@style/CustomTheme" android:name=".Activity" android:label="AppName">
...
        </activity>
11
  • Have you gone through the link that you have mention here?? If yes then this is what i have also written that you have to create your custom title bar. First try to read whatever are copying and pasting....
    – Sujit
    Commented Jun 9, 2011 at 10:35
  • yes i did ... you wrote how to build "custom bar" by dissabling real one and make a fake one in Layout ... this link provide information how to build real custom bar in "android way"
    – Selvin
    Commented Jun 9, 2011 at 10:46
  • 1
    @Selvin Ok what so special about your this CustomWindow, what if I create a base Activity using Sujit procedure and extend all activities of my app with that base activity is not that code reusability, then I must say you should write a book on design pattern, its easy to critic on one rather than admiring
    – ingsaurabh
    Commented Jun 10, 2011 at 9:34
  • 1
    "This is android title bar and you can not increase its size." <= yeah sure this is correct answer :)
    – Selvin
    Commented Jun 10, 2011 at 10:58
  • 8
    Eh... this answer is the RIGHT one. The one before this was kinda useless to me... Upgrade this one please folks. It's actually helpful. Commented Jul 17, 2011 at 5:52
1

This is android title bar and you can not increase its size. It you need this feature in your application then you can create a custom title bar.

Remove the this default Title bar by using this code in your activity..

getWindow().requestFeature(Window.FEATURE_NO_TITLE);

or this in your manifast inside your activity tag.

android:theme="@android:style/Theme.NoTitleBar.Fullscreen" 

and then create a custom title bar in your XML file.

2
  • 4
    it's not true ... this answer is wrong ... disabling title bar and making own in activity layout it's not a real solution
    – Selvin
    Commented Jun 9, 2011 at 10:27
  • @Sujit I guess that Selvin would like had say that the preffered approach is make your own Title Bar Customized. Look here
    – aspadacio
    Commented Dec 7, 2017 at 3:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.