x


Strange scrolling behavior of a native web view on iOS

I have a a very simple scene with one game object which has a script attached that shows a GUI with a few buttons and labels.

When the user clicks one of the buttons, some iOS native code is called which inits and shows a full screen UIWebView and attaches it to the current window, more or less like this:

CGRect applicationFrame = [[UIScreen mainScreen] applicationFrame];
UIWebView* webView = [[UIWebView alloc] initWithFrame:applicationFrame];
[[[UIApplication sharedApplication] keyWindow] addSubview:webView];

All of this works as expected. The one non-optimal thing I'm seeing is that, when scrolling the contents of the UIWebView, it often seems to lag behind my finger, sometimes it stops behaving like a physical scroll with inertia (it gets stuck as soon as I lift the finger off the screen), and sometimes it gets stuck on the overscroll area (it doesn't bounce and the margin remains visible).

The device's processor usage seems to remain relatively low the whole time.

I've tried to disable the Repaint method of the Unity's generated http://AppController.mm file, as described on http://millipede.com.au/blog/bridging-unity-and-the-ios-sdk/ under the Performance Gotchas section. I didn't notice any improvement.

I've also tried to attach the UIWebView to Unity's GL view instead of adding it directly to the window's subviews. Couldn't notice any difference either.

Do you think there's a way of getting normal performance on a full screen iOS native scroll or web view shown within a Unity application?

more ▼

asked May 16 '12 at 12:59 PM

iangael gravatar image

iangael
0 1 1 1

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

I had the same problem. In addition to the unreliable scrolling, some links didn't work. Both problems seem to have been solved by changing a line in AppController.m:

Change this line

#define USE_DISPLAY_LINK_IF_AVAILABLE 1

to

#define USE_DISPLAY_LINK_IF_AVAILABLE 0
more ▼

answered Jun 04 '12 at 05:00 PM

Faikus gravatar image

Faikus
1

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1969
x664
x76
x65
x10

asked: May 16 '12 at 12:59 PM

Seen: 1160 times

Last Updated: Jun 04 '12 at 05:00 PM