处理后的效果图 (待定上传)
JXCategoryListContainerViewDelegate
提供了一个可选的协议方法:
@optional/** 返回自己设置UIScrollView或者UICollectionView的Class 某些特殊情况需要自己解决UIScrollView内部逻辑。比方项目用了FDFullscreenPopGesture,需要解决手势相关代理商。 @param listContainerView JXCategoryListContainerView @return 自己设置UIScrollView实例 */- (Class)scrollViewClassInlistContainerView:(JXCategoryListContainerView *)listContainerView;
看到这个我就知道怎样弄了,咱们可以自己设置一个自己设置UIScrollView或者UICollectionView 在里面实现手势的控制,我这里初始化[[JXCategoryListContainerView alloc] initWithType:JXCategoryListContainerType_ScrollView delegate:self]
因而需要自己设置一个UIScorllView
来控制手势,让它兼容多种手势共存
1.ServiceScrollView.h
@interface ServiceScrollView : UIScrollView<UIGestureRecognizerDelegate>@end
2.ServiceScrollView.m
@implementation ServiceScrollView/** 重载UIScrollView手势 能否支持多手势触发,1.返回YES,则可以多个手势一起触发方法;2.返回NO则为互斥 // called when the recognition of one of gestureRecognizer or otherGestureRecognizer would be blocked by the other // return YES to allow both to recognize simultaneously. the default implementation returns NO (by default no two gestures can be recognized simultaneously) // // note: returning YES is guaranteed to allow simultaneous recognition. returning NO is not guaranteed to prevent simultaneous recognition, as the other gesture's delegate may return YES */- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer { if (gestureRecognizer.state != UIGestureRecognizerStatePossible) { return YES; } else { return NO; }}
JXCategoryListContainerViewDelegate
- (Class)scrollViewClassInlistContainerView:(JXCategoryListContainerView *)listContainerView{ return [ServiceScrollView class];}