Re: Hide/Show Views
Re: Hide/Show Views
- Subject: Re: Hide/Show Views
- From: Stéphane Sudre <email@hidden>
- Date: Thu, 3 May 2001 13:46:08 +0200
On jeudi, mai 3, 2001, at 09:02 , email@hidden wrote:
OK, a simple one: How do I hide/show a subview? There must be something
simpler than mucking around with replaceSubview:with:, right?
Some code to do the equivalent of Show/Hide can be:
Hiding:
if (isGroupDisplayed_==YES)
{
isGroupDisplayed_=NO;
[IBgroup_ retain];
[IBgroup_ removeFromSuperview];
}
Showing;
if (isGroupDisplayed_==NO)
{
isGroupDisplayed_=YES;
[IBmainGroup_ addSubview:IBgroup_];
[IBgroup_ release];
}
the IBmainGroup_ view contains the IBgroup_ view in the .nib.