UITapGestureRecognizer *PressRecognizer1 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handlePress:)];
[PressRecognizer1 setNumberOfTouchesRequired:1];
[firstBtn addGestureRecognizer:PressRecognizer1];
-(void)handlePress:(UITapGestureRecognizer*)PressRecognizer {
NSLog(@"working");
if (PressRecognizer.state == UIGestureRecognizerStateBegan) {
UIButton *whichButton=(UIButton *)[PressRecognizer view];
NSLog(@"whichButton %d\n",whichButton.tag);
if (whichButton.tag == 0) {
NSLog(@"currentImageId1 %d",currentImageId1);
[delegate imageZoom:currentImageId1];
}
工作我已創建了customcell其上的圖像hadlePress
方法具有每row.When抽頭三個圖像一個UITabelView
called.But如果條件i未進來第一個。UITapGestureRecognizer不與的UIButton
@rckoenes沒有ü哪裏編輯我的代碼? – user2134883 2013-03-07 10:55:59
「UITapgesture不能處理圖像」 - 代碼中的圖像在哪裏? – 2013-03-07 10:59:47
我在按鈕上添加了圖像。 – user2134883 2013-03-07 11:00:57