如何在UIImage中实现跑马灯效果动画。
我有一张云的图像(320*480)。我需要从右到左连续地对其进行动画处理,而不会出现任何滞后和消失。下面是一个 html 示例。
http://www.quackit.com/html/codes/html_marquee_code.cfm
从上往下数第二个(连续滚动文本:)。
请帮忙
最佳答案
UIImage *clouds = [UIImage imageNamed:@"Clouds"];
UIImageView *cloudView = [[UIImageView alloc] initWithImage:clouds];
CGRect origin = CGRectMake(320, 0, clouds.size.width, clouds.size.height);
CGRect destination = CGRectMake(0, 0, clouds.size.width, clouds.size.height);
cloudView.frame = origin;
[self.view addSubview:cloudView];
[UIView animateWithDuration:5 delay:0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear animations:^{
cloudView.frame = destination;
} completion:nil];
关于iphone - iPhone uiimageview 中的跑马灯效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12613982/