Vic*_*cky 4 iphone uibutton uigesturerecognizer ios
我怎样才能获得UILongPressGestureRecognizeruilabel.当我实现以下代码时,它不会调用该函数.请告诉我,我做错了什么?
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(LabelLongPressed:)];
longPress.minimumPressDuration = 0.5; // Seconds
longPress.numberOfTapsRequired = 0;
[objlblDuplicate addGestureRecognizer:longPress];
[longPress release];
Run Code Online (Sandbox Code Playgroud)
ada*_*ali 21
默认情况下,UILabel无法获取触摸事件.
objlblDuplicate.userInteractionEnabled = YES;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3441 次 |
| 最近记录: |