-
Notifications
You must be signed in to change notification settings - Fork 2.4k
IOS orientation Change fixed header not resizing #3956
Comments
In testing this seems to only happen when there is an ul li on the page. I am in the process of trying to narrow it down fully but the ul li does not seem to be the problem more having to do with the css. I have recreated the css and made a custom ul li listing component and the change works but when I start to add more styles its failing, not sure just yet but will post back when I find the problem line. |
I can confirm this issue using 1.1.0 RC2. However, (at least for me) I cannot narrow it down to pages containing ul li. I have eight single page templates in my project, four of which show this issue. The contents of the affected pages is as follows:
Unfortunately I have no time to do minimals for reproducing the error right now. |
Because of time and needing to submit to the app store I just bound to the resize event and then got that width and changed the header and footer accordingly. That seems to work in both IOS and Android, oddly enough though Android did not like it when I bound to the orientation change and tried to resize, although android did not have the same issue as IOS and seemed to resize correctly. After doing more research on it I found that it was not so much the LI and UL that was the issue but the width of the page elements. So for example if my LI had content that was long enough then the resize worked just fine but if the LI was not long enough it would crap out and not cover the top of the page on the change but doing a small movement causes a trigger to resize the header. I tried a tone of different things but the only thing that worked was resize . |
I have the same problem with 1.1 final and a simple list. |
Can someone post up a test page using latest so we can give this a look? Template: http://jsbin.com/ivawuc/edit |
Not sure if this is the exact same issue but it's most likely related. I'm working on a web app for our photography website and am noticing the same issue where when I rotate on an iPhone 4 with 5.1.1 on it that it does not expand without scrolling down on the page and then fixes itself. Two points at least in my case that my help tie down the problem. #1 this does not happen in safari. It only happens in standalone mode. #2 this also only happens on the first page that's loaded and not on subsequent ajax loaded pages. My mobile app is located here: |
Just had a quick look at app.leightyphotography.com and noticed the issue again where content div comes before header on subsequent ajax loaded pages. Note that this app loads 1.1.0, not latest code. |
So you're saying it's doing it to you on subsequent pages as well? Or are you saying on subsequent pages the content div comes before the header and that's what causes it to work? I'm too familiar with the differences between 1.1.0 and latest. My thought was 1.1.0 is the latest released option. Is latest just for developers so it contains so called BETA, ALPHA or RC versions of 1.1.1? I'm more than happy to switch over to latest for testing but do not want it to create new issues. Thanks. |
hi @triwav Sorry for the confusion. My comment was more a note to other team members. When looking at other issues with fixed toolbars we noticed this re-order of header and content. I am not saying that this is what causes the "not resizing" issue, but it could mean there is a relation with other issues. Just something we have to look into. With "latest" I refer to the code as it is right now, not latest/current stable release (1.1.0 at the moment). This is what should be used for test pages because maybe an issue has been fixed already or changes have been made that affect the issue. It would be very helpful if you could provide a simple test page that reproduces the issue, using our JSBin template that loads latest code. You can find it here: https://github.com/jquery/jquery-mobile#issues Thanks! Edit: I forget to mention that I don't have an iPhone 4 here to test on so I can't confirm the issue. |
Alright, I've built a test page based off that template. The main changes are adding to the head. Making the header fixed and using a listview instead of the content that is given in the template. As I said before, it doesn't show up in safari only in standalone mode. Go to http://app.leightyphotography.com/headerTest2 add it to the homescreen and run it from there. Changing to landscape causes the header not to change size. One other thing I noted is if I remove some list items so that it doesn't completely fill the screen then everything is fine as well. |
@triwav - Can you try this http://jsbin.com/otepum/92/ on your iPhone and let me know if you see any improvement? FYI - this template only contains first page so I removed the links from the list |
Just tried it and it's still got the issue. |
I made the test page load this script: https://github.com/scottjehl/iOS-Orientationchange-Fix |
The problem persists with your test case so I assume we can rule that out. I also use the 1.1.0 release and have reported this bug before. My app Am 16.06.2012 um 10:33 schrieb Jasper de Groot
|
That still didn't work. Same issue. On Jun 16, 2012, at 4:33 AM, Jasper de Groot [email protected] wrote:
|
I closed #2518 as duplicate of this issue. |
Any news on the issue? I still have the problem as well: using jquery mobile 1.1.1. |
I have the same problem. It doesn't appear when trying my app in the browser. It only happens on a few pages, though the html/css of the header/footer is the same. I found out it only happens when my content is to large for the screen and you need to scroll, pages without scroll work fine. |
FYI: In jQuery Mobile 1.2.0 Alpha the problem is still present. |
The beta of the next version of a popular OS for mobile phones does not However, my initial view is now missing the header logo and a textless I still refer to jQm 1.1.0. My gutt feeling on both of these errors is that Am 21.08.2012 um 16:54 schrieb "B." [email protected]: FYI: In jQuery Mobile 1.2.0 Alpha the problem is still present. — |
Adding this (forcing resize of headers) at the top of your javascript worked for me. This fixes headers. If you are using footers you need to have a width line and selector for the footer class as well. $(window).resize(function() {
$(".ui-header").width($(window).width());
}); NOTE: (edited) - This code needs to be included AFTER jquery and phonegap have initialized - for example in your OnDeviceReady() |
I believe I'm seeing the same thing using PhoneGap 2.0.0 and jQuery Mobile 1.1.1. I do not see the issue in the emulators. I have added the HTML portion of the code to http://jsfiddle.net/davidhooey/gRhwN/. I am unable to reproduce pointing a mobile device to this jsfiddle. When switching to landscape mode the header and footer do not expand to the right. After scrolling the text down a bit it will re-adjust. After the initial adjustment it seems to do fine until I go away from the page and come back. |
We do have a fix to temporarily disable zoom on iOS to workaround the zoom bug. Wondering if that timing is sometimes breaking the re-flow. |
Unfortunately I am seeing the same exact issue as davidhooey and the force resize by BeerSmith is not correcting the issue |
Make sure you add my script (above) after everything has been initialized - it won't work if you just put it in the HTML file. It needs to run after JQuery and phonegap have been fully loaded. |
Thanks for the clarification BeerSmith. Your code worked for me. For specifics, I placed the code in the myApp.js within the onDeviceReady() function. |
That did the trick, thanks! On Sep 12, 2012, at 7:41 PM, Brad Smith [email protected] wrote:
|
I've gone through all the test pages that are present on this bug on iOS5.1.1 & iOS6 and have not replicated the issue successfully. On the first, the header doesn't resize until redraw is complete (after the page completes the rotation), but it does resize successfully after that. All the others seem to maintain the correct size the entire time. Thanks, |
Re-opening because this it still seems to be an issue (see #5620). |
FYI... I faced this issue on recent 1.3.1 version on Android device. However, in my case it turned out that this happened only when I minified the jquery.mobile.structure.css using YUI. When I replaced that with official minified version, it worked! However, I am still minifying the custom theme css and my css files with YU. |
I just tested this with latest code on iPad Retina, iOS 6.1, Safari, Chrome and webview and can't reproduce the issue anymore. Test page: http://jsbin.com/otepum/372 @arschmitz - Can you test on iPhone 4? Thanks! |
@uGoMobi, I have tested your latest jsbin page on an iPhone 4S, iOS 5.1, from the homescreen. The issue remains with the above combination, the header does not resize on changing orientation from portrait to landscape, and only resizes when scrolling the page. |
@anthonyac - Thanks a lot for testing! Too bad the changes we made so far didn't fix it yet. We keep looking into a solution. |
Additional test page to reproduce (only in homescreen mode) problem: <meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-touch-fullscreen" content="yes" /> Why don't invoke |
$.widget("mobile.toolbar", $.mobile.toolbar, {
_makeFixed: function () {
this._super();
this._bindOrientationEvent();
},
_bindOrientationEvent: function () {
this._on(window, {
"orientationchange": "_fixPosition"
});
},
_fixPosition: function () {
var $window = $(window);
$window.scrollTop($window.scrollTop());
}
}); |
Fixed example: |
@uGoMobi Better to move this fix from toolbar to orientation widget: var $window = $(window);
$window.bind("orientationchange", function () {
$window.scrollTop($window.scrollTop());
}); Steps to reproduce problem:
And try repeat the same with orientation fix http://jsbin.com/unIfIwIh/11 |
Will this only scroll the complete page to the top? Not the content? So when you rotate from the bottom of a long page, you will not end up at the top? Any scrolling away from the 'current' position in page is not desirable. |
@Ruffio |
Does this issue only wait for a PR? Who should make the PR? |
Would it be an idea to include this in the 1.4.5 ios release? It is high priority since 2012 and there seems to be found a solution... |
@Ruffio Pr's are welcome on any issue though of course there is no guarantee they will be accepted. |
On IOS when viewing the rc1 and nightly with fixed header the orientation change both fixed header and footer do no expand after orientation. They will change a few second after or if you move the screen but it make it look kind of sloppy.
I tested it on a new ipod with the RC1.1 demo code and the nightlies same result.
The text was updated successfully, but these errors were encountered: