iOS 之動畫(位移/透明/縮小/擴大)
阿新 • • 發佈:2019-01-26
位移:
UIView * testView;
UIView.animateWithDuration(1, animations: {
testView.center.x = self.view.bounds.width - testView.center.x;
});
透明:
UIView.animateWithDuration(1, animations: {
testView.alpha = 0;//透明度為0
});
縮小/擴大UIView.animateWithDuration(1, animations: {
testView.transform
});
顏色改變:UIView.animateWithDuration(1, animations: {
testView.backgroudColor = [UIColor redColor];
});