Resize UIView Animations

I started trying to recreate the buy button from the app store, which requires a two-step click to buy something. I have to revitalize the extension button. While I have it

[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.75]; sender.autoresizesSubviews = NO; sender.clipsToBounds = NO; sender.frame = CGRectMake(63,326,200,37); [UIView commitAnimations]; 

which just makes the button get bigger, it doesn't come to life at all. Did I do something wrong or did someone else implement this button behavior?

EDIT:

 - (IBAction) buyButtonAction: (UIButton *) sender { [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimationDelay:0.5]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; sender.clipsToBounds = NO; sender.frame = CGRectMake( CGRectGetMinX( sender.frame) - 30, CGRectGetMinY(sender.frame), 200, 37); [sender setTitle:@"Touched Touched Touched" forState:UIControlStateNormal]; [UIView commitAnimations]; } 
+4
source share
1 answer

Have you targeted iOS that doesn't support blocks?

I implemented an animate button on the touch screen using the following sickeningly simple code.

 [UIView animateWithDuration:0.5 animations:^{ self.navigationItem.rightBarButtonItem.title = @"Quoting..."; }]; 

Alternatively, this code also works to animate a button when touched, if you cannot support blocks (it also includes blocks commented out if you are following this route):

 -(IBAction) clicked:(UIButton*)sender{ [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; [UIView setAnimationDelay:0]; [UIView setAnimationCurve:UIViewAnimationCurveEaseIn]; //[UIView animateWithDuration:2.5 animations:^{ sender.autoresizesSubviews = NO; sender.clipsToBounds = NO; sender.frame = CGRectMake(63,326,200,37); //sender.frame = CGRectMake( CGRectGetMinX( self.theButton.frame) - 100, CGRectGetMinY(self.theButton.frame), 300, 40); //[sender setTitle:@"Touched Touched Touched" forState:UIControlStateNormal]; //}]; 
+7
source

All Articles