标签:
- (IBAction)top:(UIButton *)sender
{
CGRect btnFrame = self.headBtn.frame;
btnFrame.origin.y -= 10;
self.headBtn.frame = btnFrame;
}
self.headBtn.frame.origin.y -= 10;
[UIView beginAnimations:nil context:nil];
/** 需要执行动画的代码 **/
[UIView commitAnimations];
[UIView animateWithDuration:0.5 animations:^{
/** 需要执行动画的代码 **/
}];
CGAffineTransform CGAffineTransformMakeTranslation(CGFloat tx, CGFloat ty) ;
CGAffineTransform CGAffineTransformMakeScale(CGFloat sx, CGFloat sy);
CGAffineTransform CGAffineTransformMakeRotation(CGFloat angle)
(angle是弧度制,并不是角度制)
在某个transform的基础上进行叠加
CGAffineTransform CGAffineTransformTranslate(CGAffineTransform t, CGFloat tx, CGFloat ty);
CGAffineTransform CGAffineTransformScale(CGAffineTransform t, CGFloat sx, CGFloat sy);
CGAffineTransform CGAffineTransformRotate(CGAffineTransform t, CGFloat angle);
清空之前设置的transform属性
view.transform = CGAffineTransformIdentity;
一个UIImage对象代表一张图片,一般通过imageNamed:方法就可以通过文件名加载项目中的图片
(文件名可以省略扩展名)
UIImage *image = [UIImage imageNamed:@"btn_01"];
在用代码创建按钮的同时指定按钮样式
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
UIButtonTypeInfoLight:
UIButtonTypeInfoDark:
UIButtonTypeContactAdd
标签:
原文地址:http://www.cnblogs.com/YangFuShun/p/4315750.html