新建UIView分类
- (void)setSubScrollsToTop:(BOOL)scrollsToTop{
[[self subviews] enumerateObjectsUsingBlock:^(UIView *obj, NSUInteger idx, BOOL *stop) {
if ([obj isKindOfClass:[UIScrollView class]]) {
[(UIScrollView *)obj setScrollEnabled:scrollsToTop];
*stop = YES;
}
}];
}
网友评论