i use code create UIButton ,how use CSAnimationView
langhua9527 opened this issue · 4 comments
langhua9527 commented
how to add animation to my button
my button like this
loginButton = [UIButton buttonWithType:UIButtonTypeCustom];
[loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_def.png"] forState:UIControlStateNormal];
[loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_focus.png"] forState:UIControlStateHighlighted];
loginButton.frame = CGRectMake(35,400, 250, 50);
[loginButton setTitle:@"登 陆" forState:UIControlStateNormal];
[loginButton.titleLabel setFont:XYXY_SYSTEM_FONT(18)];
[loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted];
[loginButton addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
thank you
zhangenwen commented
搜索关东升 动画 或者翻墙用youtube有大把教程
发自我的 iPad
在 2013-12-25,20:34,langhua9527 notifications@github.com 写道:
how to add animation to my button
my button like thisloginButton = [UIButton buttonWithType:UIButtonTypeCustom]; [loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_def.png"] forState:UIControlStateNormal]; [loginButton setBackgroundImage:[UIImage imageNamed:@"login_button_focus.png"] forState:UIControlStateHighlighted]; loginButton.frame = CGRectMake(35,400, 250, 50); [loginButton setTitle:@"登 陆" forState:UIControlStateNormal]; [loginButton.titleLabel setFont:XYXY_SYSTEM_FONT(18)]; [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [loginButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [loginButton addTarget:self action:@selector(login) forControlEvents:UIControlEventTouchUpInside];
thank you
—
Reply to this email directly or view it on GitHub.
realsnake commented
Embed your UIButton in a UIView, and set the view's class to CSAnimationView.
jamztang commented
@langhua9527 I guess @realsnake has answered your problem.
3r1k83 commented
It's not working for me. The method is not called.