Skip to content

解决UIScrollView嵌套滑动手势冲突问题,适用于复杂的首页或个人主页

License

Notifications You must be signed in to change notification settings

ArchLL/HGPersonalCenterExtend

Repository files navigation

HGPersonalCenterExtend

License MIT Platform Pod version

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • iOS 9.0+
  • Objective-C
  • Xcode 10+

Installation

HGPersonalCenterExtend is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'HGPersonalCenterExtend', '~> 1.3.2'

Main

1.使用Masonry方式布局;
2.解决外层和内层滚动视图的上下滑动冲突问题;
3.解决segmentedPageViewControllerscrollView横向滚动和外层scrollView纵向滑动不能互斥的问题等;
4.支持全屏返回;

Plan

1.支持刷新;
2.HGCategoryView支持更多样式 ;

Show

image

Usage

Example: HGPersonalCenterExtend/Example

1.新建一个主控制器(可参照ExampleHGPersonalCenterViewController),并继承自HGNestedScrollViewController,在这里你只需要设置pageViewControllerscategaryView相关的属性,不需要关心嵌套的交互逻辑;

2.嵌套逻辑交互封装在HGNestedScrollViewController中,大家可根据自己实际业务需求进行自定义;
问:为什么这个控制器不直接放进HGPersonalCenterExtend库中呢?
答:这是为了方便大家DIY(改个基类/改个样式),你们可以将其文件拖到自己的项目中,稍加改动即可使用;

3.新建需要的子控制器, 需要继承自HGPageViewController,其他正常开发即可;

4.如果你的pageViewController下的scrollViewUICollectionView类型,需要额外进行如下设置:

// 因为当collectionView的内容不满一屏时,会导致竖直方向滑动失效,所以需要设置alwaysBounceVertical为YES
_collectionView.alwaysBounceVertical = YES;

Recommend

如果想实现头部背景视图放大的效果,可关注我另一个库:HGPersonalCenter

Blog

简书

Author

Arch, mint_bin@163.com

License

HGPersonalCenterExtend is available under the MIT license. See the LICENSE file for more info.

About

解决UIScrollView嵌套滑动手势冲突问题,适用于复杂的首页或个人主页

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published