1. 程式人生 > >UITextView輸入框不讓出放大鏡,貼上功能

UITextView輸入框不讓出放大鏡,貼上功能

寫UITextView的繼承類,在.m中重寫下面方法

-(void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer

{

if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizerclass]]) {

        gestureRecognizer.enabled = NO;

    }

    [superaddGestureRecognizer:gestureRecognizer];

}

-(BOOL)canPerformAction:(

SEL)action withSender:(id)sender

{

returnNO;

}