-(void)startMove
{
CGFloat w = CGRectGetWidth(self.frame);
_houseView = [[UIImageView alloc] init];
_houseView.image = [UIImage imageNamed:@"Anihouse"];
_houseView.frame = CGRectMake(-w, 64, w*2, 45);
[self addSubview:_houseView];
[self animation];
}
- (void)animation
{
CGFloat w = CGRectGetWidth(self.frame);
[UIView animateWithDuration:2.0
delay:0
options:UIViewAnimationOptionRepeat|UIViewAnimationOptionCurveLinear
animations:^{
_houseView.frame = CGRectMake(0, 64, w*2, 45);
}
completion:^(BOOL finished) {
}
];
}
ios实现无限图片跑马灯
最新推荐文章于 2024-05-22 09:53:53 发布