Android-actionbar entry interface Flicker problem solved

Source: Internet
Author: User

Problem Analysis:

Mainly because when the application is opened, the current interface is not the first interface, before it, there is an interface launched, the only purpose of this interface is to start the main interface, it is not displayed. Nevertheless, the theme of this interface is not uniformly processed, its actionbar may be black, but then the Actionbar may be white, which leads to a sense that actionbar will blink white screen when entering the main interface.

Workaround:

Just find this interface and then change the theme of the interface, as in the following example

<resources xmlns:android= "Http://schemas.android.com/apk/res/android" > <style name= "Appbasetheme" parent= "@android: Style/theme.funui" > <item name= "Android:windowfullscreen" >true</item> </style> <!--application theme.  --<style name= "Apptheme" parent= "Appbasetheme" > <!--all customizations that is not specific to a Particular api-level can go here. --<item name= "Android:actionbartabtextstyle" > @style/customactionbartabtextstyle</item> < Item Name= "Android:actionbartabstyle" > @style/settingsactionbartabview</item> <item name= "Android: Actionbarstyle "> @style/settingsbarstyle</item> <item name=" Android:actionmodestyle "> @style/ actionmodestyle</item> <item name= "Android:actionmodesplitbackground" > @android:d rawable/ic_menu_ close_clear_cancel</item> </style> <style name= "Apptheme.main" parent= "@style/apptheme" >
<!--can't be background-->.
<item name= "Android:windowbackground" > @color/window_color</item> <item name= "Android: Actionbarstyle "> @style/settingsbarstyle.main</item> </style> <style name=" Settingsbarstyle.main ">
<!--Actionbar does not display content--
<item name= "Android:displayoptions" >@NULL</item> </style></resource>

Once you've defined a app.main, find the boot screen.

  <activity            android:name= "com.vz.gallery3d.VzGalleryActivity"            android:theme= "@style /apptheme.main "            android:cleartaskonlaunch=" true "android:screenorientation=" Portrait "             Android:uioptions= "Splitactionbarwhennarrow" ></activity>

There is a problem here, that is, before we set the background, you will find that jump on the face of the Actionbar hit the goal, but this time the main interface will flash white, the initial thought is, may also need to set the interface background, and then set the

<item name= "Android:background" > #000000 </item> then it seems to be a perfect solution to the problem, but again, the new problem is that you will find that the black is not at the bottom, but on the second floor. , that is, you open a picture, you will find this picture is completely covered by this black. Then replaced it with <item name= "Android:windowbackground" > @color/window_color</item> perfect problem Solving

Android-actionbar entry interface Flicker problem solved

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.