4
如何在uilabel上获取UILongPressGestureRecognizer
?当我实现下面的代码时,它不会调用该函数。所以请告诉我我做了什么错误?UILabel UILongPressGestureRecognizer不工作?
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(LabelLongPressed:)];
longPress.minimumPressDuration = 0.5; // Seconds
longPress.numberOfTapsRequired = 0;
[objlblDuplicate addGestureRecognizer:longPress];
[longPress release];
Thankyou @adali现在工作正常 – Vicky
LongPressedGesture虽然被认可了两次。第一次是长按发生,第二次是长按从手指放开。 – coolcool1994