UITextView 禁止弹出复制

来源:互联网 发布:火力银电淘宝哪家店有 编辑:程序博客网 时间:2024/05/22 17:04

    UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizeralloc] initWithTarget:selfaction:@selector(longPressAction)];

    longPress.minimumPressDuration =0.5f;

    [textViewaddGestureRecognizer:longPress];

    

    UITapGestureRecognizer *doubleTap = [[UITapGestureRecognizeralloc] initWithTarget:selfaction:@selector(longPressAction)];

    doubleTap.numberOfTapsRequired =2;

    [textViewaddGestureRecognizer:doubleTap];

    // 识别长按双击手势

    [longPress requireGestureRecognizerToFail:doubleTap];


  暂时没找到更好的办法,只是在textView上添加2个手势.


0 0
原创粉丝点击