Reputation: 13
i developed an android app by using html5 and phonegap (cordova 2.7.0); it's an application for image search, use the google API. Returns a list of images that start with a tap.
It works perfectly on almost all devices, but on small screens with Android 2.3.x, scrolling (or click on image) does not work.
Any suggestions?
Thanks in advance.
Upvotes: 1
Views: 5432
Reputation: 550
If you don't want to go through the trouble of adding iScroll you can also use:
// Workaround for problematic scrolling behaviour on Android
// we can't fix this in css directly as it breaks iOS and the
// platform selector in css is unreliable
if ( device.platform === 'Android' ) {
$('.ui-mobile, .ui-mobile .ui-page, .ui-mobile [data-role="page"], .ui-mobile [data-role="dialog"], .ui-page, .ui-mobile .ui-page-active ').css("position", "initial");
}
Upvotes: 0
Reputation: 8859
While 2-Stroker's answer is the correct one here is a quick and dirty solution, add a few <br>
tags at the end. Worked for me ;)
Upvotes: 0
Reputation: 6282
You have run into an android bug. Overflowing DIVs inside BODY tag wont allow you to scroll. Same bug was there in iPhone (iOS < 5), but there atleast you could use two fingers and scroll.
However there are workarounds for it. You can use third party libraries such as iScroll, touchScroll ...
iScroll will disable your inputs for the div which you have applied scroll to. If its a simple paragraph use iScroll.
Upvotes: 2