Tuesday, July 5, 2011

How to remove subviews from a UIScrollView

Easy peasy,

The only thing we need to do is go through all subviews and remove from superview. For example:



NSArray* subviews = [NSArray arrayWithArray: scroll.subviews];
for (UIView* view in subviews) {
if ([view isKindOfClass [UIImageView class]]) {
[view removeFromSuperview];
}
}
[subviews release];


Hope help!!

Sergio

No comments:

Post a Comment