1

我有: - 一个 AppDelegate 类 - 两个 viewController 类 - 三个 nib 文件(MainWindow.xib、firstView.xib、secondView.xib)

我想要:secondView.xib 里面应该有一个 UIScrollView,这样我就可以在视图中添加很多东西,并且可以向下滚动。

我现在必须在哪里符合 UIScrollViewDelegate 协议?我觉得 AppDelegate 类是错误的地方,因为它远离第二个视图,并不是我所有的视图都想使用 UIScrollView。

4

1 回答 1

1

since UIScrollView is located in the secondView.xib I assume its functionality is limited to that view. If you have an instance of UIViewController that serves as the controller for the secondView.xib then the best place to implement UIScrollViewDelegate would be on that UIViewController directly. You are correct that implementing it on the AppDelegate doesn't make sense if you have a more specific derived controller where it should belong. Hope this helps!

于 2009-04-08T20:26:36.793 回答