我有一個很奇怪的問題有一個UIWebView:
我在我的appdelegate一個函數,它會打開一個UIWebView來顯示我的隱私政策。該函數從兩個不同的視圖中調用兩次。一旦用戶點擊登錄屏幕上的按鈕,以及用戶點擊位於谷歌地圖視圖頂部的視圖上的按鈕一次。
當從登錄視圖調用函數時,一切正常,我可以,但是當從另一個視圖調用該函數時,UIWebView出現但不完全可操作(用於測試我加載google.com):
I不能滾動,我不能打開大多數的聯繫,唯一的元素,它響應觸摸事件被標記在這張照片:
UIWebView的部分操作
這裏來我的代碼: 在我的appdelegate我:
- (void)showPrivacy:(UIView *)view
{
overlay = [[UIView alloc] initWithFrame:view.frame];
overlay.backgroundColor = [UIColor blackColor];
overlay.alpha = 0;
[view addSubview:overlay];
privacyView = [[WPPrivacyView alloc] initWithFrame:CGRectMake(15, 40, view.frame.size.width-30, view.frame.size.height-75)];
privacyView.layer.shadowColor = [UIColor blackColor].CGColor;
privacyView.layer.shadowOffset = CGSizeMake(0, 1);
privacyView.layer.shadowOpacity = 0.75;
privacyView.layer.shadowRadius = 20.0f;
privacyView.userInteractionEnabled = YES;
privacyView.scrollView.scrollEnabled = YES;
privacyView.scrollView.bounces = NO;
privacyView.scalesPageToFit = YES;
[view addSubview:privacyView];
[UIView animateWithDuration:0.1 animations:^{
privacyView.alpha = 1;
}];
privacyView.transform = CGAffineTransformScale(CGAffineTransformIdentity, 0.1, 0.1);
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
bounceAnimation.values = [NSArray arrayWithObjects:
[NSNumber numberWithFloat:0.1],
[NSNumber numberWithFloat:1.1],
[NSNumber numberWithFloat:0.95],
[NSNumber numberWithFloat:1.0], nil
];
bounceAnimation.duration = 0.3;
bounceAnimation.removedOnCompletion = NO;
[privacyView.layer addAnimation:bounceAnimation forKey:@"bounce"];
privacyView.layer.transform = CATransform3DIdentity;
}
要隱藏我呼叫的視圖: - (void)hidePrivacy {UIView animateWithDuration:0.3動畫:^ {0}隱私視圖.alpha = 0; privacyView.transform = CGAffineTransformScale(CGAffineTransformIdentity,0.1,0.1); }完成:^(BOOL完成){ [privacyView removeFromSuperview]; }]; } 的showPrivacy函數從登錄視圖和地圖視圖稱爲如下:
WPAppDelegate *appDelegate = [[UIApplication sharedApplication]delegate];
[appDelegate showPrivacy:self.view];
那麼,爲什麼一切工作正常,當web視圖顯示在登錄視圖,我爲什麼可以操作一些元素,但不是全部,當它出現在地圖視圖中時?