tags:

views:

71

answers:

1

I am using this code to stop uiwebview bounces vertically and its work fine in simulator 4.0.But when i installed my app in my first generation ipod it wont work.

for (id subview in webView.subviews)
  if ([[subview class] isSubclassOfClass: [UIScrollView class]])
    ((UIScrollView *)subview).bounces = NO;

Can anyone help me? Is there any reason beyond this ?

Thanks in advance......

A: 

I'm having the same problem on my iPhone running 3.1.3 (building with iOS 4.1 SDK).

There is a lot of discussion on the issue in this question (but I haven't found a solution that works for me yet):
http://stackoverflow.com/questions/500761/stop-uiwebview-from-bouncing-vertically

As a workaround I tried setting the background colour so the bounce would match the white background of my HTML being displayed. Unfortunately you get left with a grey gradient that still looks bad. Somebody else has asked how to solve that issue here (but no answers yet):
http://stackoverflow.com/questions/3009063/remove-gradient-background-from-uiwebview

Dan J
You can disable bounces once your HTML loads by executing `preventDefault()` against Javascript move events.
Justin