Hi,

I'm trying to get double tab to work in a WebView.
I was reading an 
http://www.codingventures.com/2008/12/using-uiwebview-to-render-svg-files/
article  that showed how it is done in Objective C:

<code>
-(UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {  
        NSSet *touches = [event allTouches];
        BOOL forwardToSuper = YES;
        for (UITouch *touch in touches) {
                if ([touch tapCount] >= 2) {
                        // prevent this 
                        forwardToSuper = NO;
                }               
        }
        if (forwardToSuper){
                //return self.superview;
                return [super hitTest:point withEvent:event];
        }
        else {
                // Return the superview as the hit and prevent
                // UIWebView receiving double or more taps
                return self.superview;
        }
}
</code>

I'm trying to do the same thing in MonoTouch, but I can't get it to work.
<code>
        public class HtmlContentControl : UIWebView
        { 
// .....
        public override UIView HitTest (PointF point, UIEvent uievent) {
                var result = base.HitTest (point, uievent);
                
                NSSet touches = uievent.AllTouches;
                touches.Enumerate(delegate (NSObject obj, ref bool stop) {
                        UITouch touch = obj as UITouch;
                        if (touch != null) {
                                if (touch.TapCount == 2) {
                                        result = this.Superview;
                                } else {
                                        result = base.HitTest (point, uievent);
                                }                       
                        } 
                });
        
                return result;
        }
//....
}
</code>
it seens the /touches.Enumerate/ is not looping.
Does anybody know how it is done?
many thx,
Roeland

--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/WebView-Double-Tab-tp3773051p3773051.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to