Created
February 10, 2012 10:09
-
-
Save mpociot/1788369 to your computer and use it in GitHub Desktop.
simplified button animation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)btn_reg_onClick:(id)sender { | |
reg_animation_modus = !(reg_animation_modus); | |
int k; | |
if( reg_animation_modus ){ | |
k = 1; | |
[btn_einloggen setTitle:@"Registrieren" forState:UIControlStateNormal]; | |
} else { | |
k = -1; | |
[btn_einloggen setTitle:@"Einloggen" forState:UIControlStateNormal]; | |
} | |
[UIView animateWithDuration:1.0 animations:^{ | |
CGRect frame = btn_einloggen.frame; | |
frame.origin.y += key_max_reg_animation_count * k; | |
btn_einloggen.frame = frame; | |
frame = tf_pw_r.frame; | |
frame.origin.x += (key_max_reg_animation_count*30) * k; | |
tf_pw_r.frame = frame; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment