我怎样才能得到UILongPressGestureRecognizer
在 uilabel.当我实现以下代码时,它不会调用该函数。那么请告诉我我做错了什么?
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(LabelLongPressed:)];
longPress.minimumPressDuration = 0.5; // Seconds
longPress.numberOfTapsRequired = 0;
[objlblDuplicate addGestureRecognizer:longPress];
[longPress release];
默认情况下,UILabel 无法获取触摸事件。
objlblDuplicate.userInteractionEnabled = YES;
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)