Reputation: 23
I have UIButton on view, when I taped on this button I want to create new view and display it on iPad screen, how I can view this view like growing from button to full screen ?
Upvotes: 1
Views: 1735
Reputation: 20021
On the button click event.
Create the view with frame with size zero and orgin as center of button
2.add to mainview
3.Then using animation block change the frame to orginal
What are block-based animation methods in iPhone OS 4.0?
use this qn to find how to add animation
Upvotes: 0
Reputation: 38728
Next time actually show some effort with what you have tried etc when asking for help
- (void)buttonTapped:(UIButton *)button;
{
UIView *expandingView = [[UIView alloc] initWithFrame:button.frame];
expandingView.backgroundColor = [UIColor redColor];
[self.view addSubview:expandingView];
[UIView animateWithDuration:.25f
animations:^{
expandingView.frame = self.view.bounds;
}];
}
Upvotes: 4