Android + Phonegap上的水平滚动图像 + jQuery手机[英] Horizontally scrollable image on Android + PhoneGap + jQuery Mobile

本文是小编为大家收集整理的关于Android + Phonegap上的水平滚动图像 + jQuery手机的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在处理一个可用于Android和iPhone的应用程序. 该应用程序是使用jQuery Mobile完成的,并使用PhoneGap编译.

有时在应用程序中,用户可以显示图像,此图像非常大,需要滚动. 我已经完成了一个JavaScript代码,该代码与Theses css属性创建DIV并将其附加到身体:

position: absolute;
width: 100%;
height: 100%;
z-index: 1200;
background-color: black;
overflow: scroll;

在iPhone上运行完美,用户可以根据自己的意愿滚动​​. 在Android上没有,屏幕保持锁定,用户只能滚动.

index.html页面上的viewport是这样的:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

我花了大约2个小时的时间来玩它,在互联网上查看,但没有找到使屏幕在Android上滚动的任何内容.

我不能使它成为另一个页面,因为我的应用程序非常深入,因为我的应用程序非常深刻.而且我将无法将用户带回他想查看图像时离开的确切位置.

我的想法已经用完了,已经测试了几天.有人会有一个想法可以帮助我在Android上进行可滚动的弹出式弹出式弹出式弹出式?

谢谢

推荐答案

要在Android的WebView中创建可滚动区域,您将需要使用模拟本地功能的JavaScript框架.那里有几个好的:

另外,请注意,iOS版本中不支持可滚动区域(用户必须使用两个手指来滚动旧版本).

).

本文地址:https://www.itbaoku.cn/post/102366.html

问题描述

I'm working on an application that will be available for Android and iPhone. The application is done using jQuery Mobile and compiled with Phonegap.

Sometimes in the application a user can display an image, this image is very large, and needs to be scrollable. I've done a javascript code that creates a div with theses css properties and appends it to the body:

position: absolute;
width: 100%;
height: 100%;
z-index: 1200;
background-color: black;
overflow: scroll;

On iPhone it works perfectly, the user can scroll as far as he wants on the right. On Android it doesn't, the screen stays locked and the user can only scrolldown.

The viewport on the index.html page is like this:

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

I've spend about 2 hours playing with it, looking on the internet, but didn't find anything that made the screen to be scrollable on Android.

I cannot make it be another page, with a different viewport because my application is very deeply javascripted. And I wouldn't be able to bring back the user to the exact spot where he left when he wanted to view the image.

I'm running out of ideas, and have been testing it for a few days. Would someone have an idea that would help me to make a scrollable popup on android ?

Thank you

推荐答案

To create scrollable areas in a WebView for Android you will need to use a JavaScript framework that mimics the native functionality. There are several good ones out there:

Also, note that scrollable areas are not really supported in iOS versions less than 5.0 (the user has to use two fingers to scroll in older versions).