StevenTB
StevenTB

Reputation: 410

Disabling Webview vertical scrolling to keep parent element scrolling

I succeed to disable the vertical scroll in a WebView (Universal Apps, Windows Phone 8.1) thanks to the overflow:hidden CSS property.

It works well but I would like to save the parent scrolling which is a StackPanel, because if my WebView height is higher than my device screen, I can't scroll to the bottom..

Does anyone have an idea ?

Upvotes: 4

Views: 1169

Answers (2)

Joe
Joe

Reputation: 2601

Try to use

html, body{
    -ms-touch-action: none;
    -ms-user-select: none;
}

Thanks

Upvotes: 1

tdmanutd
tdmanutd

Reputation: 301

If you don't need a click event on the webview, you can use a rectangle over the webview:

       <ScrollViewer>
         <StackPanel>
                <WebView x:Name="WebviewContent" VerticalAlignment="Top" DefaultBackgroundColor="Transparent" /> 
                <Rectangle Height="{Binding Height, ElementName=WebviewContent}" Name="RecWeb" VerticalAlignment="Top" Fill ="#00000000" />
         </StackPanel>
         </ScrollViewer>

Upvotes: 0

Related Questions