Android Removal title bar

Source: Internet
Author: User

1. If your activity is inherited from activity, then

A. To write in Style.xml:

<style name= "apptheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>
</style>

B. Write in the application tag in Androidmanifest.xml:

Android:theme= "@style/apptheme"

2. If your activity is inherited from Appcompatactivity, then

A. To write in Style.xml:

<style name= "apptheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>

<item name= "Windowactionbar" >false</item>
</style>

B. Write in the application tag in Androidmanifest.xml:

Android:theme= "@style/apptheme"

Note: The above two methods will set all the pages to no title bar status.

3. If you do not want to set all the pages have no title bar, but the individual pages no title bar

For example: only mainactivity the corresponding page does not have the title bar, the other is the default state, then

A. To add in the Style.xml:

<style name= "apptwotheme" parent= "Theme.AppCompat.Light.DarkActionBar" >
<item name= "Windownotitle" >true</item>
<item name= "Windowactionbar" >false</item>
</style>

B. In the Activity tab in Androidmanifest.xml, write:

<activity android:name= ". Mainactivity " android:theme=" @style/apptwotheme ">
<intent-filter>
<action android:name= "Android.intent.action.MAIN"/>
<category android:name= "Android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

Android Removal title bar

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.