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