Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使我的应用程序屏幕截图的绿色区域能够随着分页动画和页面指示器滚动?我希望我添加更多图标按钮,同时保持标题大小相同。
首先,您需要一个滚动视图,并且您的视图必须位于滚动视图内。然后你需要在滚动视图上启用分页
[scrollView setPagingEnabled:YES];
如果此属性的值为 YES,则当用户滚动时,滚动视图会在滚动视图边界的倍数处停止。默认值为 NO。
如果你想拥有你需要使用的页面指示器UIPageControl,据我所知,你必须自己管理。滚动后,您可以随时根据滚动视图UIScrollViewDelegate的属性检查您所在的页面(参见 参考资料) 。contentOffset
UIPageControl
UIScrollViewDelegate
contentOffset