user1560793
user1560793

Reputation: 23

Resize UIView from point with animation

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

Answers (2)

Lithu T.V
Lithu T.V

Reputation: 20021

On the button click event.

  1. 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

Paul.s
Paul.s

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

Related Questions