在 UITextview 中禁用放大镜

Disable Magnifying Glass in UITextview(在 UITextview 中禁用放大镜)

本文介绍了在 UITextview 中禁用放大镜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

UITextview 中,当长按触摸时放大镜会出现.如何禁用它.

In UITextview when touch is pressed for the longer time magnifying glass shows up. How can i disable it.

推荐答案

最后这个问题也解决了

这是供任何人需要时参考的代码

Here is the code for reference in case anyone needs

在子类UITextview的m文件中添加代码

in the m file of subclassed UITextview added code

-(void)addGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer 
{
    //Prevent zooming but not panning
    if ([gestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) 
    {
        gestureRecognizer.enabled = NO;
    }
    [super addGestureRecognizer:gestureRecognizer];
    return;
}

有效.

这篇关于在 UITextview 中禁用放大镜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:在 UITextview 中禁用放大镜

基础教程推荐