0

I used webview in my project to display html contents. But it doesn't scroll with page( scrollviewer). I have set the height of the webview to the height of the content using java script. But it doesn't scroll. I also tried this custom control. It scrolls perfectly but it doesn't allow user interaction. I can't click on links. Basically they are overlaying a Grid on webview so that it scrolls but doesn't allow interactions. Is there any way that makes webview scrolls with page contents and at the same time making links clickable? Your suggestions are welcome.

Archana
  • 3,213
  • 1
  • 15
  • 21
  • you can write a javascript function(that would do the scrolling) in the webview. So when the page contents get scrolled, call the function with the help of InvokeScriptAsync method of webview. – Chirag Shah Aug 05 '16 at 13:28
  • I'm setting the height of the webview to height of its contents. So basically there is nothing to scroll in webview. It's content is fully expanded. But it's below the visible area of the phone. – Archana Aug 05 '16 at 13:59
  • Little code and gist of use-case would help. – Chirag Shah Aug 08 '16 at 05:49
  • You can check the custom control I used.. – Archana Aug 08 '16 at 05:59
  • load the control in a scrollviewer. that would scroll the entire control. and you sure that you have set the InteractionsEnabled property properly,because by default its false, that would have disabled the link clicks that you made. – Chirag Shah Aug 08 '16 at 09:50
  • Yes with interactionallowed false, it scrolls webview. But I have set it to true. – Archana Aug 08 '16 at 15:49
  • Control is inside scrollviewer – Archana Aug 08 '16 at 15:49
  • You meant to say grid in UserControl has to be replaced with scrollviewer? – Archana Aug 08 '16 at 15:57
  • no I suggested to place the usercontrol inside a scrollviewer. can you open a chat? that would be appropriate. and if possible post some of your own code(where you have set the usercontrol and its properties.) – Chirag Shah Aug 09 '16 at 06:53
  • My code is exactly same as the custom control which I have posted in the question. – Archana Aug 12 '16 at 14:49
  • Using this solution http://stackoverflow.com/questions/30705584/windows-phone-8-1-handle-webview-vertical-scroll-by-outer-scrollviewer-element link is clickable now. – Archana Aug 12 '16 at 14:51
  • But sometime document.body.offsetheight gives wrong height. Sometime there will be lot of empty space, sometime content will be cliped because of less height. Do you have any idea? – Archana Aug 12 '16 at 14:56
  • the resolution of the device must be causing that issue. Use DisplayInfo class to debug that. – Chirag Shah Aug 16 '16 at 07:56
  • @ChiragShah can you look into this question http://stackoverflow.com/questions/40542131/facebook-single-sign-on-not-working-in-windows-phone-8-1-app-running-on-windows? – Archana Nov 21 '16 at 04:14

0 Answers0