标签:
- (IBAction)top:(UIButton *)sender {
CGRect btnFrame = self.headBtn.frame;
btnFrame.origin.y -= 10;
self.headBtn.frame = btnFrame;
}
//在Xcode6以后编译成功
self.headBtn.frame.origin.y -= 10;
// 创建一个自定义的按钮
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
// 默认状态的背景
[btn setBackgroundImage:[UIImage imageNamed:@"btn_01"] forState:UIControlStateNormal];
// 默认状态的文字
[btn setTitle:@“点击我" forState:UIControlStateNormal];
// 默认状态的文字颜色
[btn setTitleColor:[UIColor redColor] forState:UIControlStateNormal];
[UIView beginAnimations:nil context:nil];
/** 需要执行动画的代码 **/
[UIView commitAnimations];
[UIView animateWithDuration:0.5 animations:^{
/** 需要执行动画的代码 **/
}];
(angle是弧度制,并不是角度制)
view.transform = CGAffineTransformIdentity;
标签:
原文地址:http://www.cnblogs.com/Opaser/p/4595178.html