UIViewController 是否可以遵循 UIScrollViewDelegate,然后引导到下一个要滚动页面的视图?
我正在尝试开发一个程序,其中第一个屏幕包含一个按钮,单击按钮后,它应该带我进入滚动视图和页面控件。我已经成功地分别开发了这两个模块。但我在整合它们时遇到了问题。第一个模块让我点击并带我进入下一个屏幕,另一个模块以滚动视图和页面控件启动,如 Apple 提供的 PageControl 示例中所示。请帮忙。感谢您抽出时间。真的很感激。
I am trying to develop a program wherein which the first screen contains a button and after the click of the button, it should take me to a scroll view and a page control. I have successfully developed these two modules separately. But I am facing problems in integrating them. The first module lets me click and takes me to my next screen and the other module starts up with a scroll view and a page control as in the PageControl sample given by Apple. Please help. Thanks for your time. Really appreciate it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为让第一个视图控制器成为不同视图控制器的视图对象的委托并不是一个很好的设计。相反,让第一个 VC 向第二个 VC 发送消息,告诉它想要显示什么。然后,第二个 VC 可以使用
-setContentOffset:animated:
将滚动视图推送到正确的位置。I don't think having the first view controller be a delegate for a different view controller's view objects would be a nice design. Instead, let the first VC send a message to the second VC, telling it what it wants to be displayed. The second VC can then use
-setContentOffset:animated:
to push the scroll view to the correct place.