-
Notifications
You must be signed in to change notification settings - Fork 2.4k
White flash/flicker when transiting between 2 web pages in Phonegap #4024
Comments
To remedy this, a quick fix is to remove data-position-"fixed" . All mentioned above applies only to an iOS phonegap mobile app. It doesn't seem to be reproduced on desktop or mobile safari. |
This happens in iOS in full-screen mode too (after adding the web-app to the home-screen). Any plan to fix this soon? But it didn't work... |
I think I just found a temp workaround: .header {position:fixed;z-index:10;top:0;width:100%} |
I did some further investigation and produced 2 files for testing using in phonegap 1.4.0 and JQM 1.1.0. To replicate. run the files as a phonegap app in iOS 5.1. and click on the signup and then back button to replicate index.html
signup.html
|
In my earlier comment, changing the transition from slidefade to slide also has weird flashing issues
to
|
This might be related or a duplicate #3735 |
I have also attempted to use http://code.jquery.com/mobile/1.1.0/jquery.mobile.structure-1.1.0.css to replace the original css file and also discover that the flickering and flashing persists. |
Some stackeroverflow posts have made suggestions below but they did not work for me particularly when there is a long body of text in the content div div .ui-page { |
Hi al - we're looking into this. This forum post seems to have an interesting fix that we're going to review |
Adding my 2 cents... it is really FRUSTRATING to see every page flicker even in 1.1.0 final! I read almost every blog/forum regarding this issue and nothing really could solve it. It really is extremely bad when there's more content on the page and if you've scrolled down and then trigger the transition... Btw, mine is an HTML5 app using JQM 1.1.0 + Cordova on iOS 5.1 on a 4S |
You can solve it temporarily be adding your own classes to the footer / content / header instead of the data-position:fixed attribute. e.g. .header {position:fixed;z-index:10;top:0;width:100%} |
same issue |
Just as a test, I did what @orenagiv suggested and turned off my fixed header and footer and put the CSS in place. While testing in my Phonegap app as well as just in the browser, It became clear to me that the fixed toolbars are definitely contributing to the blinky transitions. So, it's not just causing a white/flash flicker in Phonegap as is covered by this issue. I love the progress that was made to get the fixed toolbars to the state they are in now. Unfortunately though, it seems that there are some side effects caused by the magic that was used. Another test I ran, and actually ended up leaving in place, was to set all of my transitionFallbacks to none. That way, if running on a platform that doesn't have good support for the 3d transforms, it just turns off the transitions. The result is far better than the default fade. |
@dcarrith Do you have some jsfiddles for comparison? Think that will be helpful for the devs |
@elfgoh, I don't, but it looks like the docs for fixed positioning toolbars has the same sort of flashy/blinkyness on Android 2.3.7 (probably other platforms too, I'm just not at home right now to test). Turning off fixed toolbars on that page or a similar test page would likely reduce the flashy blinkyness as I observed last night. I've never used jsfiddle, but I can give it a shot tonight and see what I can put together. |
…, focus, scrolling, setting height) called ui-page-pre-in. This class sets the opacity of the TO page to 0 during this momentary process, which at least in my testing, prevents fixed toolbars and pages from flickering during transitions when fixed toolbars are used in a web app mode in iOS (not Safari, but native webview). Fade transition is particularly improved. Addresses, but perhaps doesn't completely fix Issue #4024
For me, that CSS tweak suggested by @orenagiv didn't make any difference. With the regular fixed toolbars, the main issue I saw was the toolbar on the TO page flickering in and out during the transition. However, applying the suggested CSS to static toolbars instead made for a much more flickery overall transition for me - where pages were blinking twice rather than an odd toolbar. After a lot of tinkering tonight, the following commit seems to do some good, at least in Fade transitions on my iOS5 device: Alternatively, people could choose to just hide the toolbars during transitions, which would help too, if also changing the effect a bit. The css for that would be something like this: Anyway, how's the commit test out for you? Any better? |
Did you remember to remove the data-position=fixed when applying the CSS tweak? |
I'll definitely try out the .ui-page-pre-in opacity tweak when I get home tonight. Thanks Scott! |
I did yes. I just changed your example selectors to use "ui-" prefixes for static toolbars. On Apr 21, 2012, at 1:06 AM, orenagiv wrote:
|
Maybe you have a conflict with other "ui-" In any case, it's just a very temporary solution. I will also try the opacity suggestion soon. |
scott thanks! I will try this when i get home and let u know |
Hi all - Scott's fixes from this morning seem to have made a big difference. For a quick and dirty simulation of an embedded web view, similar to PhoneGap (same rendering deal, minus phone gap.js), go to the config test page below, save it to your home screen in iOS, then open it and browse the docs. If you test 1.1, in fullscreen mode, you'll see a flash even when just browsing normal pages with the fade transition. If you try the fixed header page, there is a nasty double blink: On master, I just tried master after the fixes from this morning and it's waaay better. Both of thee flashes are gone. Awesome work by @scottjehl Please test in PhoneGap to confirm. Let us know how this is looking... |
I can confirm that Scott's additions work. I just tested using the latest build unstructured css http://code.jquery.com/mobile/latest/jquery.mobile.structure.min.css and js http://code.jquery.com/mobile/latest/jquery.mobile.min.js |
It's amazing how a small change like that makes such a difference. I just tested in my phonegap app on the following devices: I also tested my app as a homescreen app and it looks like the blinky/flashy stuff is gone. Nice work Scott! |
Hey, I like waking up to news like this. Good to hear. Close this out then, shall we? |
I think we can now that we have 3 confirmations this change fixed things up. Thanks again Scott, working magic. |
Other suggestions worked to some degree, but I still had problems during transitions, so here's my hack. I used these values for effect, so change to your liking... Just drop it somewhere within your html
|
I tried all the different methods (jQuery Mobile 1.3.2) on the web and nothing seems to work, it is the last issue I have before deployment. Is there away to have the flickering appear in another color (black) ? |
@nadacambia |
Using <meta name="viewport" content="width=device-width, user-scalable=no" /> in the header fixed it for me as well (on Android. I didn't try on iOS yet). |
Can you test if setting the option |
this issue is worse than ever on 1.4.0 alpha 2, i've tried around ten different "fixes" none successful. |
I think this whole flashing issue on IOS is because of the device-height. if in the index.html meta content you set height=device-height, the whole flickering problem during page transition is totally gone, but then you have these problem with the page content too long and a scrollbar always appear no matter how little content you have on your page. if you dont set the height to device-height, well, you get this hellish annoying blinking. I think its because the device-height is till used to calculate some values in jqm, and in the end the difference in device-height and actual screen height differs, which cause this reset every time you load a new page, thus the blinking. I tried with 1.3.2, 1.4.0alpha2 with height set to device height with no flickering at all during the page transition. but without height set, well... So is there anyway to fix this somehow? |
This (also linked above) worked for me: http://zsprawl.com/iOS/2012/05/fixing-the-transitions-in-jquery-mobile-1-1-0/ The comment above implies that it has been fixed but it hasn't been since that fix still fixes the problem. |
@eagsalazar Well, this solution doesnt really fix the problem, the flickering still occur, just a little less, not same as set the content height=device-height, in that case no flickering at all. but then have this horrible scroll problem, Ahhhh, the lesser of two evil... or maybe just use something else instead of jqm... |
Eh yeah. I personally would not use it again. On Tue, Aug 27, 2013 at 4:35 PM, dongdh notifications@github.com wrote:
|
In iOS, After the splash screen the html screen goes blank. But the buttons work fine if i tap at the right position. This is only happening in the Ios same code works fine on all the andriod devices/os. |
Combination of all latest versions of jqm,phonegap,jq in the app |
In jquery.mobile.structure-1.3.2.min.css (because I am using a custom theme) > line 12 > changed .ui-mobile,.ui-mobile body{height:99.9%} to > .ui-mobile,.ui-mobile body {height:100.5%} worked for me. |
Any fix for this yet? Using jquery.mobile-1.4.0, jquery-1.10.2, and latest phonegap w/ newly generated android platform files. Flashing white between page changes (links with data-ajax="false"). Like some users above, I've tried dozens of these fixes, and nothing seems to work; Page transitions are none, background color important on the body, background color in android manifest, .ui-page backface-visibility in the CSS (bad, breaks other things), the meta viewport changes, setting hardwareAccelerated to false, etc. From what I've read, this has to do with WebView when the page loads, and may be more of a phonegap issue...can't find a solution. |
Change the default transition to slide for now, or something else. Works great for me. --- Original Message --- From: "jawinn" notifications@github.com Any fix for this yet? Using jquery.mobile-1.4.0, jquery-1.10.2, and latest phonegap w/ newly generated android platform files. Flashing white between page changes (links with data-ajax="false"). Like some users above, I've tried dozens of these fixes, and nothing seems to work; Page transitions are none, background color important on the body, background color in android manifest, backface hidden in the CSS (bad, breaks other things), the meta viewport changes, etc. Reply to this email directly or view it on GitHub: |
@jawinn Not sure if that can be fixed. If you load a page without Ajax, your entire screen refreshes. Just like standard websites in a browser after clicking a link. Only on mobile the pagechange is noticed better. I might be wrong, and perhaps someone from the jQuery Mobile team has a better answer, but I think that cannot be solved. |
@teusinkorg Seems like it. I ended up switching to use AJAX on all the pages, and it's okay now. I still get a thin white line that sometimes appears at the bottom (and sometimes stays until scrolling up/down), but that may be part of the Android 4.0.3 issues I'm encountering. |
@jawinn That my be a theme "issue". Give in ThemeRoller the body a black (#000000) border in every swatch. If we are talking about the same, then it should be gine :) |
I really have no idea why on iOS $(document).on( "mobileinit", function() { is enough to do the trick but Android requires also what @sebikrt said: insert in the 'head' tag: |
An issue reported two years ago, it is labeled 'priority: high' and it is still not resolved? Is it resolved or is it because of lack of interest that it hasn't been resolved? |
Yeah - was quite active for a while... Perhaps coders have discovered a solution. For those wondering, at least using pgb 3.3, I was able to completely eradicate the issue using the following. config.xml js code (whenever I'm ready to - ex: after a setTimeout/etc) Shouldn't matter, but for completeness, here's my viewport meta tag: Cheers |
I think its always going to exist... --- Original Message --- From: "Lisa Seacat DeLuca" notifications@github.com @elfgoh @Ruffio Anyone have an update on this? Has it been fixed with the latest jQM? Just checking to see if we still need someone else to look into this or if it can be closed. Reply to this email directly or view it on GitHub: |
I don't know of any updates. I don't use Phonegap and no one has made any |
Since theres no activity and no objection on this ill close as patches welcome. |
If this is the same problem I was having, you have to make sure to put data-theme="a" (or whichever theme letter you are using) in the fixed div. The footer "forgets" the default during transitions.
|
I have 3 files in my phonegap 1.4.0 application that uses jquery mobile 1.1.0 rc2. Here is a quick description on the code before the code snippets are shown.
They are index.html, foo.html and todo_list.html
foo has the header as follows
If there is difficulty reproducing this. I can try to reproduce files. The classes on the divs should not matter as I removed the custom css reference when testing.
The text was updated successfully, but these errors were encountered: