c# - Attaching an event to UIWebView ScrollViewer prevents zooming -
whenever attach event uiwebview's scrollviewer detect scrolling prevent uiwebview zooming in , out. however, scrolling , down still works. viewing pdf in uiwebview.
i've tried these events:
scrolled scrolledanimationended zoomingended didzoom
for example tried:
contractwebview.scrollview.scrolled += (object sender, eventargs e) =>{ debug.writeline("scrolled"); };
i have event tried empty event body.
did tried set delegate scrollview instead of using events? this:
public class scrollviewdelegate : uiscrollviewdelegate { public override void scrolled(uiscrollview scrollview) { console.writeline("scrolled"); } } contractwebview.scrollview.delegate = new scrollviewdelegate();
edit: here complete code used test , worked me:
public class ipadviewcontroller1 : uiviewcontroller { public override void viewdidload() { base.viewdidload(); uiwebview webview = new uiwebview(new cgrect(0, 0, uiscreen.mainscreen.bounds.width, uiscreen.mainscreen.bounds.height)); webview.scrollview.delegate = new scrollviewdelegate(); webview.scalespagetofit = true; view.addsubview(webview); string urladdress = "http://google.com"; nsurl url = nsurl.fromstring(urladdress); //url requst object nsurlrequest requestobj = nsurlrequest.fromurl(url); webview.loadrequest(requestobj); } }
Comments
Post a Comment