Android change activity style and hide title

Source: Internet
Author: User

On Android, an activity takes up the screen by default, but we can also let him apply to a dialog box theme, making him a dialog box.


After you create a new Android project, modify the Androidmanifest.xml, add the theme attribute in it, 650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M02/59 /b0/wkiol1tcq5_qdeonaaf15c9valu369.jpg "title=" Qq20150212140604.png "alt=" wkiol1tcq5_qdeonaaf15c9valu369.jpg "/ >

After clicking Save, Run: Such as

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/59/B3/wKiom1TcQy3C18bCAACt3fcCCwI666.jpg "title=" 1.png " alt= "Wkiom1tcqy3c18bcaact3fcccwi666.jpg"/>


Finally, we can hide the title, add code 650 in Mainactivity.java) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/59/B3/ Wkiom1tcq5jtxujzaafs7wtv8aw906.jpg "title=" 3.png "alt=" Wkiom1tcq5jtxujzaafs7wtv8aw906.jpg "/>

Note: The code must be added before setcontentview this sentence, otherwise it will run the error, as the result

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/59/B3/wKiom1TcQ9nRCCzVAABw9ql3qeE310.jpg "title=" 2.png " alt= "Wkiom1tcq9nrcczvaabw9ql3qee310.jpg"/>


This article is from the "Useless Uncle" blog, please be sure to keep this source http://aslonely.blog.51cto.com/6552465/1614025

Android change activity style and hide title

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.