當點擊UITextView時,我希望它保持作爲第一響應者的工作,但我還需要觸發其他事件。在UITextView不是第一響應者之前,UITapGestureRecognizer可以正常工作,但在聚焦之後,不會再對其進行識別。如何識別文字視圖後成爲第一響應者?
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapRecognized:)];
singleTap.numberOfTapsRequired = 1;
[txtView addGestureRecognizer:singleTap];
[singleTap release];
-(IBAction)singleTapRecognized:(id)sender
{
//Does not enter here with a tap after txtView is first responder
}
你有沒有找到一個解決方案對此? –