Created
April 26, 2011 06:36
-
-
Save agiletalk/941889 to your computer and use it in GitHub Desktop.
disableScrollToTopPropertyOnAllSubViewsOf.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// for UIScrollView | |
- (void)disableScrollToTopPropertyOnAllSubViewsOf:(UIView *)view { | |
for(UIView *subview in view.subviews) { | |
if([subview isKindOfClass:[UIScrollView class]]) { | |
((UIScrollView *) subview).scrollsToTop = NO; | |
} | |
[self disableScrollToTopPropertyOnAllSubViewsOf:subview]; | |
} | |
} | |
// for UITableView | |
- (void)disableScrollToTopPropertyOnAllSubViewsOf:(UIView *)view { | |
for(UIView *subview in view.subviews) { | |
if([subview isKindOfClass:[UITableView class]]) { | |
((UITableView *) subview).scrollsToTop = NO; | |
} | |
[self disableScrollToTopPropertyOnAllSubViewsOf:subview]; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment