开发者

Can a UIViewController conform to a UIScrollViewDelegate and then lead to the next view where there are pages to be scrolled?

开发者 https://www.devze.com 2023-01-07 19:18 出处:网络
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 develope

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 开发者_StackOverflow社区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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消