【发布时间】:2012-06-22 13:48:14
【问题描述】:
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];
所以寻求帮助。
谢谢。
【问题讨论】: