UIWebView隐藏右侧和底部滚动条,去掉滚动边界的黑色背景,禁止左右滑动,
-(void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error方法中实现下面的方法:
for (UIView *_aView in [m_webView subviews]) { if ([_aView isKindOfClass:[UIScrollView class]]) { [(UIScrollView *)_aView setShowsVerticalScrollIndicator:NO]; //右侧的滚动条 [(UIScrollView *)_aView setShowsHorizontalScrollIndicator:NO]; [(UIScrollView *)_aView setAlwaysBounceHorizontal:NO];//禁止左右滑动 //下侧的滚动条 for (UIView *_inScrollview in _aView.subviews) { if ([_inScrollview isKindOfClass:[UIImageView class]]) { _inScrollview.hidden = YES; //上下滚动出边界时的黑色的图片 } } } }
参考:http://weibo.com/p/23041865aa75b60102uymy?pids=Pl_Official_CardMixFeed__4&feed_filter=1
时间: 2024-10-12 02:42:41