← Back to team overview

ubuntu-phone team mailing list archive

Re: WebView Flickable?

 

On Tue, Nov 11, 2014 at 3:47 AM, Matt Austin <mail@xxxxxxxxxxxxxxxx> wrote:
> Hi,
>
> Maybe I haven't been able to find the right documentation, but is
> there an example on how to place a WebView inside a Flickable? I would
> prefer not to have scrollbars on the webview itself, and be able to
> click+drag to scroll (on desktop, haven't tested on device).

Hi Matt,

The short answer to your question is: no, it’s not possible to do
that. Scrollbars are drawn by the renderer.

There might be a way around that, but that’s probably a pretty bad
idea, so please don’t quote me on the following:

 - set the width,height of the webview to those of the page it renders
 - set the content{Width,Height} of the flickable to width,height of the webview

you will hit performance problems as the WebView will render all the
page all the time.

Alternatively, you could probably have a flickable on top of the
webview (not containing it), ensure its content{Width,Height} match
the width,height of the webpage, and proxy its content{X,Y} to the
webpage’s scroll{Left,Top} with a userscript. That sounds like an
equally bad idea though.

Why would you need a touch-like interface on a supposedly non-touch device?


Follow ups

References