漏了make.. 应该是
self.blueSquare.center = CGPointMake(self.view.bounds.size.width - self.blueSquare.center.x);
self.blueSquare.center = CGPointMake(self.view.bounds.size.width - self.blueSquare.center.x);
2016-03-09
OC下可以用self.blueSquare.center = CGPoint(self.view.bounds.size.width - self.blueSquare.center.x);
但是OC下调整center的值后移动的是相反方向, 比当前center的x值大就会从当前位置左边移到右边. y也是同理...
求讲解.
但是OC下调整center的值后移动的是相反方向, 比当前center的x值大就会从当前位置左边移到右边. y也是同理...
求讲解.
2016-03-09
- OC代码 // 黄色视图动画效果
[UIView animateWithDuration:1.0 animations:^{
self.orgView.center = CGPointMake(self.view.bounds.size.width - self.orgView.center.x, self.orgView.center.y);
}];
[UIView animateWithDuration:1.0 animations:^{
self.orgView.center = CGPointMake(self.view.bounds.size.width - self.orgView.center.x, self.orgView.center.y);
}];
2016-02-03