UIScrollView inside a UITableView won't show/hide correctly (Xcode iPhone)
I've used Interface Builder to drop a UIScrollView into the top of a UITableView. (To do some horizontal scrolling.)
In code, I now wish to selectively show/hide that UIScrollView. I've connected it in IB, and then execute various combinations of code... but the area never disappears.
self.scrView.hidden = TRUE;
or:
CGRect aFrame = self.scrView.frame;
aFrame.size.height = 0;
[self.scrView setFrame:aFrame];
or:
[self.scrView setFrame:CGRectZero];
[self.scrView setContentSize:CGSizeZero];
开发者_如何学JAVA
or even the suggested:
[self.scrView removeFromSuperview];
Any way to make that thing disappear... including the area that it used to be in?
You can remove it from its parent view like this:
[self.scrView removeFromSuperView];
精彩评论