一个简单IOS View动画效果

2017-04-11  本文已影响0人  花开花非花

@property (strong ,nonatomic) UIView *Myview;

if (self.Myview == nil) {

self.Myview = [[UIView alloc]initWithFrame:CGRectMake(0, 100, 50, [UIScreen mainScreen].bounds.size.height)];

[self.view addSubview:self.Myview];

[self.Myview setBackgroundColor:[UIColor redColor]];

}

CGRect Temp = self.Myview.frame;

Temp.origin.x = [UIScreen mainScreen].bounds.size.width;

self.Myview.frame = Temp;

Temp.origin.x = 90;

[UIView animateWithDuration:0.8 animations:^{

self.Myview.frame = Temp;

}];

喜欢的小伙伴可以顶赞一下,或者打赏一下,不定期更新

上一篇 下一篇

猜你喜欢

热点阅读