我有一個觀點產生這樣的:iPhone - 我怎麼可能趕上一個接進一個UIWebView或一個UIImageView
oneView = [[UIView alloc] initWithFrame:CGRectMake(x, y , w, h)];
oneView.tag = i;
UITapGestureRecognizer* recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleSingleTap2:)];
[recognizer setNumberOfTouchesRequired:1];
[oneView addGestureRecognizer:recognizer];
recognizer.delegate = self;
[recognizer release];
- (void)handleSingleTap2:(UITapGestureRecognizer *)recognizer {
int viewID = recognizer.view.tag;
NSLog(@"id : %d", viewID);
}
這工作,但如果我有一個UIWebView或UIImageView的頁頭,然後更換了UIView ALLOC觸摸事件不再被觸發。
我該如何讓它工作?
默認情況下,webview將這兩個屬性設置爲yes,否則您將無法使用瀏覽器。 – 2011-04-23 13:10:27
不適用於UIWebView。 – Oliver 2011-04-23 13:11:16