Android隐藏标题栏/全屏设置

试了很多种方法,还是这种比较靠谱。

1:确认或修改AndroidManifest.xml的application内容为以下代码:

<application
android:allowBackup=”true”
android:icon=”@drawable/ic_launcher”
android:label=”@string/app_name”
android:theme=”@style/AppTheme” >

2:在res/values/styles.xml里添加以下红色内容

<resources>

<!–
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
–>
<style name=”AppBaseTheme” parent=”Theme.AppCompat.Light”>
<!–
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
–>
</style>

<!– Application theme. –>
<style name=”AppTheme” parent=”AppBaseTheme”>
<!– All customizations that are NOT specific to a particular API-level can go here. –>
<item name=”android:windowNoTitle”>true</item>
<item name=”android:windowContentOverlay”>@null</item>
<item name=”android:windowFullscreen”>?android:windowNoTitle</item>

<item name=”android:windowFrame”>@null</item> 

<item name=”android:windowBackground”>@null</item> 

<item name=”android:backgroundDimEnabled”>false</item>
</style>

</resources>

3:这样还不一定能保证全屏,特别是加图片和弹出层的时候,还需要去掉res/layout/activity_main.xml的代码

 

android:paddingBottom=”@dimen/activity_vertical_margin”
android:paddingLeft=”@dimen/activity_horizontal_margin”
android:paddingRight=”@dimen/activity_horizontal_margin”
android:paddingTop=”@dimen/activity_vertical_margin”

 

 

原创文章,转载请注明: 转载自蔡洁锐的blog

本文链接地址: Android隐藏标题栏/全屏设置

Android隐藏标题栏/全屏设置》上有178条评论

  1. Steven Garcia

    Woah! I’m realloy diigging the template/theme oof thks site.
    It’s simple, yyet effective. A llot off timees it’s
    very difficulpt too geet tha “perfect balance” bettween userr friiendliness andd appearance.
    I mmust ssay you’ve one a superb jjob wit this.
    Also, thee bllg loas exgremely quickk for mme onn Safari.
    Outstanding Blog!

    [回复]

    回复
  2. Marquis Bulluck

    I’ve been browsing online more than 3 hours
    as of late, yet I never found any attention-grabbing article like yours.
    It is beautiful value sufficient for me. Personally, if all web
    owners and bloggers made just right content material as you did, the net will be
    much more helpful than ever before.

    [回复]

    回复
  3. Gregory Healey

    It is perfect time to make some plans for
    the future and it is time to be happy. I have
    learn this publish and if I may just I desire to recommend you some interesting things or suggestions.
    Maybe you could write subsequent articles referring to this article.
    I wish to learn more issues approximately it!

    [回复]

    回复
  4. Thomas Neal

    Thanks for your article. It’s very unfortunate that over the last 10 years, the travel industry has already been able to to deal with terrorism, SARS, tsunamis, bird flu, swine flu, as well as first ever entire global economic collapse. Through it the industry has proven to be powerful, resilient plus dynamic, discovering new strategies to deal with hardship. There are always fresh difficulties and opportunity to which the sector must once more adapt and act in response.

    [回复]

    回复
  5. Alma Christy

    It is appropriate time to make some plans for the
    future and it is time to be happy. I have read this post and if I could
    I want to suggest you few interesting things or tips.
    Perhaps you could write next articles referring to this article.

    I wish to read more things about it!

    [回复]

    回复
  6. Anna Houston

    I’ve been surfing online more than 3 hours today, yet I never found any interesting article like yours.
    It is pretty worth enough for me. In my opinion, if all webmasters and bloggers made good content as you did, the web will be much more useful
    than ever before.

    [回复]

    回复
  7. Terri Tzou

    I do believe all the ideas you’ve offered on your post.

    They’re really convincing and can definitely work. Still, the posts are very quick for newbies.

    Could you please extend them a bit from subsequent time?
    Thanks for the post.

    [回复]

    回复
  8. Kristy Peary

    It’s appropriate time to make a few plans for the long run and it is time to be
    happy. I have read this submit and if I may just I desire to recommend you some attention-grabbing things or advice.
    Perhaps you could write subsequent articles regarding this article.
    I want to learn more issues approximately it!

    [回复]

    回复
  9. Elaine Short

    I’ll right away seize your rss feed as I can not in finding your e-mail subscription hyperlink or e-newsletter service.
    Do you’ve any? Kindly allow me realize so that I may
    subscribe. Thanks.

    [回复]

    回复
  10. Lee Schulte

    It is the best time to make some plans for the longer term and it is time to be happy.
    I’ve read this post and if I may I desire to recommend you some interesting things or tips.
    Maybe you can write next articles regarding this article.
    I desire to read more things approximately it!

    [回复]

    回复
  11. Diane Berberich

    It is perfect time to make some plans for the future and it’s
    time to be happy. I’ve read this post and if I could I wish to suggest you few interesting things
    or suggestions. Perhaps you could write next articles referring to this article.
    I wish to read even more things about it!

    [回复]

    回复
  12. Mary Pardue

    I’ve been browsing online greater than 3 hours today,
    yet I by no means discovered any fascinating article like yours.

    It is pretty price enough for me. Personally, if all webmasters and
    bloggers made excellent content as you did, the web will probably be much more useful than ever
    before.

    [回复]

    回复
  13. Ruby Piskura

    Hi would you mind letting me know which webhost you’re working with?

    I’ve loaded your blog in 3 completely different web browsers
    and I must say this blog loads a lot faster then most.
    Can you recommend a good internet hosting provider at
    a fair price? Thanks, I appreciate it!

    [回复]

    回复
  14. Sheryl Harris

    It’s the best time to make some plans for the future and it is time to be happy.
    I have read this post and if I could I wish to suggest you few interesting things or advice.
    Maybe you could write next articles referring to this article.

    I wish to read more things about it!

    [回复]

    回复
  15. Frank Wilson

    I have been surfing online more than 4 hours today, yet I never found any interesting article
    like yours. It is pretty worth enough for me. In my view, if all webmasters and bloggers made good content as you did, the web will
    be much more useful than ever before.

    [回复]

    回复
  16. Tina Byrd

    Hi, I do think this is an excellent website.
    I stumbledupon it ;) I may return once again since i have saved as a favorite it.
    Money and freedom is the greatest way to change,
    may you be rich and continue to guide other people.

    [回复]

    回复
  17. Imelda Young

    I’ve been browsing online more than three hours today, yet I never found any interesting article
    like yours. It is pretty worth enough for me.
    In my view, if all webmasters and bloggers made good content as you did, the
    net will be much more useful than ever before.

    [回复]

    回复
  18. Tommie Willburn

    I’ve been surfing online greater than 3 hours these days, but I by no means discovered any attention-grabbing
    article like yours. It is pretty value enough for me. In my opinion, if all web owners and
    bloggers made excellent content material as you did,
    the internet will likely be much more useful than ever
    before.

    [回复]

    回复
  19. Michael Piser

    I have noticed that online degree is getting common because attaining your college degree online has changed into a popular solution for many people. Quite a few people have not really had an opportunity to attend a traditional college or university nonetheless seek the improved earning potential and career advancement that a Bachelor’s Degree gives. Still people might have a diploma in one field but would like to pursue another thing they now have an interest in.

    [回复]

    回复
  20. Carla Glass

    It is appropriate time to make a few plans for the long run and it’s
    time to be happy. I have read this submit and if I may just I want to recommend you some interesting things or tips.
    Maybe you could write next articles referring to this article.
    I wish to learn more issues about it!

    [回复]

    回复
  21. Norman Holliday

    It’s perfect time to make a few plans for the longer term and it is time to be happy. I’ve read this publish and if I could I want to recommend you few fascinating issues or advice. Perhaps you could write next articles relating to this article. I wish to learn even more issues about it!

    [回复]

    回复
  22. marketing

    Hello would you mind stating which blog platform you’re working with?

    I’m going to start my own blog in the near future but I’m having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
    The reason I ask is because your design and style
    seems different then most blogs and I’m looking for something completely unique.
    P.S Apologies for getting off-topic but I had to ask!

    [回复]

    回复
  23. buy cialis

    It is appropriate time to make some plans for the longer
    term and it’s time to be happy. I’ve read this post
    and if I may just I wish to counsel you few attention-grabbing things or advice.
    Perhaps you can write next articles regarding this article.
    I wish to learn even more things approximately it!

    [回复]

    回复
  24. Deanne

    I’m amazed, I have to admit. Rarely do I come across a
    blog that’s equally educative and engaging, and let me tell you, you’ve hit the nail on the head.
    The issue is something not enough people are speaking intelligently about.
    Now i’m very happy I found this during my hunt for
    something concerning this.

    [回复]

    回复

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>