Lukas
Lukas

Reputation: 1366

Scrolling in Native "Web" App

I've been developing native iOS apps for 2 years now. As some customers need iOS, Android and Winphone support, i decided to play around with WebApps (HTML, JQuery mobile,..) and PhoneGap. Everything works like a charm, but now i'm getting some problems.

I want to create a native-app like feeling, but as you can see in the images attached below when i scroll down, the header always scrolls with the screen.

I hope someone can help me with this problem.

Best regards, Lukas

enter image description here

None

EDIT: I'm searching for a JS solution. (If possible)

Upvotes: 1

Views: 362

Answers (2)

Lukas
Lukas

Reputation: 1366

There are more solutions to achive, what i wanted to do. I just want to add the following info for other's searching for a solution. If you use phonegab, you can add the following code to your config.xml in order to disable the bouncing.

<preference name="webviewbounce" value="false" />

Upvotes: 1

adamdehaven
adamdehaven

Reputation: 5920

In your viewDidLoad method, add webView.scrollView.bounces = NO;

This will take care of the "bouncy" webView, and will prevent the user from scrolling beyond the top of the page.

Upvotes: 1

Related Questions