Android Studio Activity Title Research

Source: Internet
Author: User

First study Date: 2016/7/30

First, head title cancellation

Current version new project the default theme in application is Android:theme= "@style/apptheme", which exists in Res/values/styles.xml code, which may be different when created by default

<!--Base application theme. -    <stylename= "Apptheme"Parent= "Theme.AppCompat.Light.DarkActionBar">        <!--Customize your theme here. -        <Itemname= "Colorprimary">@color/colorprimary</Item>        <Itemname= "Colorprimarydark">@color/colorprimarydark</Item>        <Itemname= "Coloraccent">@color/coloraccent</Item>    </style>

To cancel the title way:

1, all the cancellation of the theme, android:theme= "" Input @style/no query, here appear the following three, should choose which can, and so do not change

Android:theme= "@style/theme.appcompat.daynight.noactionbar" android:theme= "@style/ Theme.AppCompat.Light.NoActionBar "Android:theme=" @style/theme.appcompat.noactionbar "
View Code

2, a single cancellation of the theme, is in the <activity note also exists android:theme= "", the value in the same ibid

To remove the title from your code and use it in Android studio, Eclipse looks at the code below:

// please write the following code in front of Setcontentview () supportrequestwindowfeature (window.feature_no_title);
View Code

Use this in eclipse

Requestwindowfeature (Window.feature_no_title);
View Code

With the cancellation of the header status bar code, the status bar is the top of the small black bar, showing the time, power, and so on, finger hold down can drop, eclipse the same

// also written on Setcontentview () this. GetWindow (). SetFlags (Windowmanager.layoutparams.flag_fullscreen,windowmanager.layoutparams.flag_ fullscreen);
View Code

And the use of the following labels on the internet to eliminate the title and status bar at the same time only when the file extends activity is useful, in the inheritance of appcompatactivity or actionbaractivity flashback, the reason please see the link

Http://www.eoeandroid.com/thread-559545-1-1.html?_dsign=51bbc2e6

Android:theme= "@android: Style/theme.notitlebar.fullscreen"
View Code

Second, the title bar design

Android Studio Activity Title Research

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.