Hybrid View
-
14 Sep 2010 9:43 PM #1
onOrientationChange event is not being handled properly on ip* devices by uiwebview
onOrientationChange event is not being handled properly on ip* devices by uiwebview
you're probably aware of this problem, but:
onOrientationChange event is not being properly handled by the iPhone sdk's component UIWebView, which is basically a built-in "safari" browser and is being used in all ip* apps where the browser functionality is needed.
due to this problem, none of the sencha touch demos are working properly if opened in any other browser than the native safari on ip*s: programmatic ui changes which has to happen on orientation change are not happening.
to see the problem, run kitchen sink in any 3-rd party browsers you can get from the apple's app store (atomic web, mercury, ilunascape, ifindz to name a few). the problem is especially severe on ipad.
do you have any suggestions what can be done to fix/work around this problem?
i'm ready to publish an app written in sencha (great great framework, btw, thank you!), and that is the only reason for the delay.
any help would be greatly appreciated.
thank you in advance,
yury
-
15 Sep 2010 1:26 AM #2
So why do you say this is a bug in Touch? If the browser doesn't support the orientationchange event like it should, there isn't really much we can do about it.
As a side note, it doesn't seem to support local urls (http://10.0.0.2), what a waste of a dollar!
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
15 Sep 2010 8:51 AM #3
here is why i said it is still a sencha problem:
-- i've put some js function call into my iOS code to call the page loaded into uiwebview when device orientation changes;
-- in this call i was trying to call sencha's layout routines: doLayout(), etc;
-- ui goes crazy in this case, due to the fact that some internal values in the sencha's layout engine are off and in dis-array; for instance Ext.orientation returns 'portret' in landscape, but screen dimensions look like landscape's;
-- i tried to follow some suggestions on this board and go through a "window resize" rout. it produced sporadic success/failure results on kitchen sink: sometimes ui re-renders properly, and some times - some elements are off-screen and/or have wrong sizes.
please do not be offensive, i truly love your product!
i just need some sort of suggestion from people who knows how the stuff works inside :-))
as of now, the only stable (but soooooo ugly) solution is to call 'document.location = document.location' on each orientation change, which works fine, just... not cool at all :-((
please help if you can.
thanks again.
(btw, i've purchased sencha-touch license a couple of days ago)
-
16 Sep 2010 4:25 PM #4
please respond - i need to know what can be done!
thank you...
-
16 Sep 2010 4:41 PM #5
Again, back to the original point, why doesn't the browser fire the orientationchange event? We can only react to the events made available. Have you talked with the developers of the browser?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
17 Sep 2010 2:28 AM #6
when orientation changed:
UIWebView.stringByEvaluatingJavaScriptFromString("var e = document.createEvent('Events'); e.initEvent('orientationchange', true, false); document.dispatchEvent(e); ");
sencha touch will work
-
17 Sep 2010 7:35 AM #7
thank you very much!
your solution resolved the problem!
-
27 Sep 2010 5:19 AM #8
Similar Threads
-
Sencha in UIWebView?
By bessfernandez in forum Sencha Touch 1.x: DiscussionReplies: 4Last Post: 29 Oct 2010, 12:58 AM -
Do nothing onOrientationchange.
By gabrielstuff in forum Sencha Touch 1.x: DiscussionReplies: 3Last Post: 7 Sep 2010, 4:04 PM -
changing scroll direction onOrientationChange
By cabennett85 in forum Sencha Touch 1.x: DiscussionReplies: 1Last Post: 3 Aug 2010, 1:17 PM -
[FIXED-286][3.x] GroupTabPanel's beforegroupchange event is fired/handled incorrectly
By tookoo in forum Ext 3.x: BugsReplies: 4Last Post: 9 Dec 2009, 7:46 AM


Reply With Quote
