user1410595
user1410595

Reputation: 71

Subview access to superview

I have a scrollView with its content view and finally a subview on the content view. I would like to stop scrolling [scrollView scrollEnabled:NO] from the subview. Can I get at the method?

Upvotes: 1

Views: 8585

Answers (2)

Jon Friskics
Jon Friskics

Reputation: 282

I don't have Xcode in front of me, but can't you get at the superview with self.superview from your subview code?

For instance, like so:

[subview.superview scrollEnabled:NO];

Upvotes: 4

lu yuan
lu yuan

Reputation: 7227

To stop scrolling [scrollView scrollEnabled:NO] from the subview? Maybe you need a viewController which control the views. Do you clear about the MVC?

Upvotes: 0

Related Questions