1
A
回答
3
我不是很确定,但我认为你必须通过frame.when来做动画。当你设置标签的坐标放置变量像x,y而不是参数1和2的值,并把这个在一个动画计时器中改变x和y的值。
类似的代码,它是图像可以为标签做到这一点也: - 对于简单的问题
// Build array of images, cycling through image names
for (int i = 0; i < IMAGE_COUNT; i++)
[imageArray addObject:[UIImage imageNamed:[NSString stringWithFormat:@"Frame_%d.jpg", i]]];
// Animated images - centered on screen
animatedImages = [[UIImageView alloc]
initWithFrame:CGRectMake(
(SCREEN_WIDTH/2) - (IMAGE_WIDTH/2),
(SCREEN_HEIGHT/2) - (IMAGE_HEIGHT/2) + STATUS_BAR_HEIGHT,
IMAGE_WIDTH, IMAGE_HEIGHT)];
animatedImages.animationImages = [NSArray arrayWithArray:imageArray];
// One cycle through all the images takes 1.5 seconds
animatedImages.animationDuration = 1.0;
// Repeat forever
animatedImages.animationRepeatCount = -1;
// Add subview and make window visible
[window addSubview:animatedImages];
[window makeKeyAndVisible];
// Start it up
animatedImages.startAnimating;
// Wait 5 seconds, then stop animation
[self performSelector:@selector(stopAnimation) withObject:nil afterDelay:1000];
我希望它可以帮助你.. :)
相关问题
- 1. Xamarin.Forms Marquee iOS框架
- 2. 如何制作UILabel wordwrap
- 3. 如何限制UILabel文本长度 - IOS
- 4. 如何在UILabel上制作倒影?
- 5. IOS - 如何在UITableViewCell中移动UILabel?
- 6. 如何在iOS中掩盖UILabel - Objective-C
- 7. ios:如何在uilabel中设置urllink?
- 8. 如何在html中使用Marquee?
- 9. 如何制作3D效果类似于Android网站的Marquee?
- 10. 如何在swift中限制UILabel字符?
- 11. ios在UItableView中交换UILabel
- 12. 如何角度ios中的uilabel
- 13. 如何在iOS中制作界面
- 14. 如何在ios中制作carousal动画?
- 15. 如何在UILabel缩小字体大小中制作文本
- 16. 如何在swift中从底部到顶部制作UIlabel
- 17. 如何在自定义单元格中使用autoresizingMask制作UILabel?
- 18. 如何在UITableView中获取UILabel动作?
- 19. UILabel AutoShrink属性不工作在ios 7
- 20. iOS中的UIStepper UILabel
- 21. 如何在UIView子视图中插入UILabel在iOS中
- 22. 如何在iOS中继承工作sdk
- 23. 如何在iOS中的UITextView中创建UILabel
- 24. 如何制作按钮,iOS
- 25. 如何制作iOS FBSDKProfilePictureView?
- 26. 如何在UILabel上绘制边框?
- 27. 在iOS中删除UILabel中的支架
- 28. iOS UILabel高度
- 29. iOS IBOutlet UILabel Duplicate
- 30. IOS UILabel sizeToFit
+1,这是-1所以现在它变成零。 :d – mAc