我试图让我的 UIWebView 水平反弹,它已经垂直反弹,但它只是不做水平反弹。
我像这样添加 UIWebView
// pass data off to the correct view to be used
lpViewController = [[LPViewController alloc] init];
lpViewController.view.frame = CGRectMake(0.0, infoBarHeight, lpViewController.view.bounds.size.width, lpViewController.view.bounds.size.height);
lpViewController.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
lpViewController.view.backgroundColor = [UIColor whiteColor];
[self.view insertSubview:lpViewController.view belowSubview:actionTabBar];
然后在 lpViewController viewDidLoad 方法中,我试图像这样获得水平反弹。
for (UIView *subview in [lockPositionsWebView subviews]) {
if ([subview isMemberOfClass:[UIScrollView class]]) {
[(UIScrollView *)subview setAlwaysBounceVertical:YES];
[(UIScrollView *)subview setAlwaysBounceHorizontal:YES];
}
}
lockPositionsWebView.scrollView.bounces = NO;
lockPositionsWebView.scrollView.alwaysBounceVertical = YES;
lockPositionsWebView.scrollView.alwaysBounceHorizontal = YES;
但这也不起作用,它得到垂直反弹而不是水平反弹......
任何帮助将不胜感激。