遇到这么一种需求

左滑回到关注,右滑到发现,继续右滑则是滑动下面的推荐,水彩,等等
可以使用一个scrollView,当滑动第一页的时候,调整导航UI,滑动第一页以后的,调整下面的分类UI.
不过试了试嵌套,发现也是可行的,并且不需要判断
具体实现:
拖一个UIScrollView,设置上下左右

再添加一个UIStackView,设置上下左右和宽高约束(2倍宽于scrollView)

拖动一个view和一个UIContainerView ,UIContainerView可以装一个UIViewController,选中container连线到rightVC,然后选择embed.

接着设置stackView的属性

这样第一个scrollView就完成了
接着在rightVC中添加ScrollView->UIStackView->Container

这些container可以根据业务选择连接的VC,这里全部连接一个VC

运行起来后,什么都不用写,即可实现最开始描述,当底部scrollView滑动到右边时,内部scrollView可以开始滑动,相反也是
网友评论