addSubview animation

Posted by Mike on Stack Overflow See other posts from Stack Overflow or by Mike
Published on 2010-02-25T20:32:40Z Indexed on 2010/05/14 14:04 UTC
Read the original article Hit count: 607

Filed under:
|
|

I have main UIView where I display different data. Then I put a button, which displays subview like this:

- (IBAction) buttonClicked: (id) sender
{
     UIView *newView = [[UIView alloc] initWithFrame:CGRectMake(25,25,50,20)];
 UILabel *newLabel = [[UILabel alloc] initWithFrame:CGRectMake(25,25, 50,25)];
 newLabel.text = @"some text";
 [newView addSubview: newLabel];

 [self.view addSubview: newView];
 [newLabel release];
 [newView release];
}

newView appears fine, but it doesn't animate itself any way, it just appears immediately. How can I add some kind of animation when newView appears? Like zoom or slide down or something like that. Is there some simple code?

© Stack Overflow or respective owner

Related posts about uiview

Related posts about animation