ImageView 在名为 Third 的类中定义
- (void)viewDidLoad
{
// Displays UIImageView
UIImageView* ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, 300, 235)];
self.view.backgroundColor = [UIColor brownColor];
// load all the frames of our animation
ImageView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"3a.png"],
[UIImage imageNamed:@"3b.png"],
nil];
// all frames will execute in 24 seconds
ImageView.animationDuration = 24;
// start animating
[ImageView startAnimating];
ImageView.layer.borderWidth = 2;
ImageView.layer.borderColor = [[UIColor whiteColor]CGColor];
[ImageView.layer setMasksToBounds:YES];
[ImageView.layer setCornerRadius:15.0f];
[self.view addSubview:ImageView]; }
我怎样才能从这个第三类到另一个类中获取这个图像 view.layer 的引用。
基本上我想为图像视图动画使用暂停层和恢复层。
使用
[self pauseLayer:myImageView.layer]; // Pause the CALayer of the UIImageView
我应该参考这样的东西,但不知道如何在第三类的 viewdidload 中实现它,或者在第三类或另一个类中在哪里实现它。
UIImageView *myImageView = [OtherClass getTheImageView];
所以寻求一些帮助。
谢谢。