UI栏按钮摆动动画

时间:2013-07-19 11:26:27

标签: ios objective-c uibarbuttonitem

我想出了如何创建一个带有按钮的摆动动画link。但是,如果是uibarbuttonitem,则需要transform属性。我希望为这个UIBarButtonItem创建这个摇摆动作。我怎样才能做到这一点?

1 个答案:

答案 0 :(得分:0)

试试这个,

UIButton *button = [[UIButton alloc] init];
[button setTransform:<#(CGAffineTransform)#>]; // SET YOUR TRANSFORM HERE

UIBarButtonItem *barButton = [[[UIBarButtonItem alloc] initWithCustomView:button] autorelease];
self.navigationItem.leftBarButtonItem = barButton;