我在webview中嵌入了视频,该视频是从app bundle加载的,但现在我在iOS 8.0中遇到了一个问题。
点击它时,我无法看到视频播放/暂停/停止和缩放选项面板。我可以通过捏合手势使其全屏,并且能够在全屏幕中看到选项面板但在正常播放时无法看到它。
似乎uiwebview内容不在中心或可能是其内容大小增加。我试图在网上找到它的解决方案但是找不到任何解决方案。我尝试了所有关于在uiwebview中嵌入视频的内容,但问题尚未解决。我认为播放选项已经出现,但随着内容大小的增加,所以我认为播放选项是可见的。此问题仅发生在iOS 8.0中,并且在ioS 6.0& 7.0。
我已经完成整合它的代码:
webviewFrame = CGRectMake(335, 67, 675, 670);
webview = [[UIWebView alloc] initWithFrame:webviewFrame];
[webview setBackgroundColor:[UIColor clearColor]];
[webview setOpaque:NO];
webview.delegate=self;
webview.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
[webview setScalesPageToFit:YES];
[webview.layer setMasksToBounds:YES];
[webview.layer setCornerRadius:15.0f];
[webview.layer setBorderColor:[UIColor grayColor].CGColor];
[webview.layer setBorderWidth:2.0];
[self.view addSubview:webview];
webview.hidden=NO;
webview.delegate=self;
btn_Zoom.hidden=YES;
btnMail.hidden=YES;
UIScrollView* sv = (UIScrollView*)[webview.subviews objectAtIndex:0];
sv.scrollEnabled=NO;
[webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:strPath isDirectory:YES]]];
- (void)webViewDidFinishLoad:(UIWebView *)webView{
NSLog(@"finish loading");
[appDelegate hideIndicator];
self.view.userInteractionEnabled=YES;
CGSize contentSize = CGSizeMake(webView.frame.size.width,
webView.frame.size.height);
webview.scrollView.contentSize = contentSize;
[webview setScalesPageToFit:YES];
self.automaticallyAdjustsScrollViewInsets = YES;
self.edgesForExtendedLayout = YES;
}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
NSLog(@"error=%@",error);
[appDelegate hideIndicator];
self.view.userInteractionEnabled=YES;
CGSize contentSize = CGSizeMake(webView.frame.size.width,
webView.frame.size.height);
webview.scrollView.contentSize = contentSize;
[webview setScalesPageToFit:YES];
self.automaticallyAdjustsScrollViewInsets = YES;
self.edgesForExtendedLayout = YES;
}
请告诉我这个问题的准确解决方案,因为我试图在过去2天内解决这个问题。