1
我正在UIScrollView上嘗試這段代碼,但它不工作。 NSLog沒有出現在我的控制檯上。怎麼了?它的工作很好,當它不在UIScrollView。Objective C:UILongPressGesture on ScrollView
- (void)viewDidLoad
{
[super viewDidLoad];
[self papers];
UIGestureRecognizer *recognizer = [[ UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)];
longPressGR = (UILongPressGestureRecognizer *)recognizer;
longPressGR.minimumPressDuration = 0.5;
[Image1 addGestureRecognizer:longPressGR];
}
-(void) handleLongPress:(UILongPressGestureRecognizer *)recognizer {
NSLog(@"Long Press");
}
這就像是某個班級的作業嗎? 2人問同樣的問題哈哈。 http://stackoverflow.com/questions/8937458/objective-c-uilongpressgesturerecognizer-error – Altealice
哈哈!是啊,也許你看到我的朋友拉米羅。我們正試圖自己解決這個問題。 – SeongHo