UIWebView并安装问题

时间:2010-02-06 06:49:51

标签: iphone

我有两个问题让我遇到麻烦。

  1. 我在UIView上放了一个UIWebView,然后我无法获得触摸事件,我能得到的就是来自UIView。
  2. iphone是否可以在安装时运行应用程序?另一方面,它可以在完成安装后立即启动。

1 个答案:

答案 0 :(得分:0)

问:1 因为UIWebview吃掉了触摸,所以触摸不会进入UIView 如果需要触摸,则需要使用方法

为应用程序窗口创建子类
- (void)sendEvent:(UIEvent *)event {
 //NSLog(@"tap detect");
 NSArray *allTouches = [[event allTouches] allObjects];
 UITouch *touch = [[event allTouches] anyObject];
 UIView *touchView = [touch view];

 if (touchView && [touchView isDescendantOfView:<your webview>]) {
  //
  // touchesBegan
  //
 }
}

问2.我不知道