How to increase the size of the title bar in an Android application?

前端 未结 2 1264
不知归路
不知归路 2020-12-09 05:14

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

\"\"

相关标签:
2条回答
  • 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.

    0 讨论(0)
  • 2020-12-09 05:52

    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>
    
    0 讨论(0)
提交回复
热议问题