[英]Loading webViews using iCarousel doesnt scroll when swiping on centre View
I am using iCarousel
library to load UIWebView
s. 我正在使用
iCarousel
库来加载UIWebView
。 I am unable to scroll the carousel
when i swipe on the center view. 当我在中心视图上滑动时,我无法滚动
carousel
。 When i swipe outside the centre View, I do not have any problem in scrolling. 当我在中心视图外滑动时,滚动时没有任何问题。 I do not have the similar problem when i use
UIImageView
. 我使用
UIImageView
时没有类似的问题。 I am facing this problem only for UIWebview
. 我只针对
UIWebview
面临这个问题。 I am using the below code to create the web views in viewForItemAtIndex
method. 我使用以下代码在
viewForItemAtIndex
方法中创建Web视图。
-(UIView *)carousel:(iCarousel *)carousel1 viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view {
UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(50, 0, 100, 100)];
return webView;
}
Can anyone please help me to fix this issue? 有人可以帮我解决这个问题吗?
This is probably a gesture recognizer issue preventing the carousel pan gesture from working. 这可能是一个手势识别器问题,阻止旋转木马平移手势工作。 It seems you can't set your controller as the delegate of the
webView.scrollView.panGestureRecognizer
so, you will need to edit the carousel because it doesn't make the panGestureRecognizer
it uses publicly available. 看来你不能设置你的控制器作为的代表
webView.scrollView.panGestureRecognizer
所以,你需要编辑旋转木马,因为它不会使panGestureRecognizer
它使用公开。 Edit it to add your controller as the delegate and then you can return YES
from gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
. 编辑它以将控制器添加为委托,然后您可以从
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
返回YES
gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:
. Alternatively, you can hide this inside the carousel by making it the delegate of its own gesture... 或者,您可以将其隐藏在旋转木马中,使其成为自己手势的代表......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.