//frame属性中的坐标点不能直接修改 CGRect tempFrame = self.v.frame; // 1.取出原来的属性
tempFrame.origin.y+=10;//2.坐标点y加10 相当于向下移动10
self.v.frame=tempFrame;//3.赋值
//因为其始终以自身左上角为坐标原点,所以只能修改尺寸,修改位置不会改变 CGRect tempBounds = self.v.bounds;
tempBounds.size.height-=10;
tempBounds.size.width-=10;
self.v.bounds=tempBounds;
CGPoint tempCenter = self.v.center;
tempCenter.y -= 10;
self.v.center = tempCenter;
//修改位置 UIButton *v = (UIButton *)[self.view viewWithTag:1]; v.transform=CGAffineTransformTranslate(v.transform, 0, -10); //修改尺寸 v.transform=CGAffineTransformScale(v.transform, 2, 2);//增大倍数 //修改角度// 角度是正数:顺时针, 角度是负数:逆时针 v.transform=CGAffineTransformRotate(v.transform, -M_PI_4); //向左旋转45°
原文:http://www.cnblogs.com/yangjingqi/p/4889913.html