【发布时间】:2015-06-23 07:07:42
【问题描述】:
我正在使用 iCarousel 显示一组图像,并且我想禁用滑动手势。我在文档中没有找到。不确定这是否可行
【问题讨论】:
-
那么您想以编程方式更改图像吗?
标签: ios swipe-gesture icarousel
我正在使用 iCarousel 显示一组图像,并且我想禁用滑动手势。我在文档中没有找到。不确定这是否可行
【问题讨论】:
标签: ios swipe-gesture icarousel
如果您想禁用滑动手势,那么我想您是否想要以编程方式更改图像。
非常简单地禁用轮播的用户交互。
如果您使用情节提要,则只需删除 User Inreaction Enabled 的复选标记
如果您通过代码使用,则使用以下代码禁用User Inreaction Enabled
yourcarousel.userInteractionEnabled = FALSE;
希望这对解决您的问题有很大帮助。
【讨论】:
@Junchao GU 如果你正在使用
他们正在使用点击手势和平移手势 你必须评论
UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(didPan:)];
panGesture.delegate = (id <UIGestureRecognizerDelegate>)self;
[_contentView addGestureRecognizer:panGesture];
//add tap gesture recogniser
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTap:)];
tapGesture.delegate = (id <UIGestureRecognizerDelegate>)self;
[_contentView addGestureRecognizer:tapGesture];
在 iCarousel.m 文件中
希望对你有帮助
【讨论】:
更改 iCarousel 的源代码是个坏主意。我认为接下来最好做:
carouselView.contentView.gestureRecognizers?.removeAll()
希望对某人有所帮助
【讨论】: