我在我的代码中有一个NSArray设置来显示两个PNG的交替闪烁,我试图设置一段代码,将其设置为隐藏状态,将其移出屏幕,任何事物都不能看到用户。隐藏NSArray - 我该怎么做?
的代码为我的数组是
NSArray *imageArray = [[NSArray alloc] initWithObjects:
[UIImage imageNamed:@"CONNECTED dark yellow FF CC 00.png"],
[UIImage imageNamed:@"CONNECTEDR dark yellow FF CC 00.png"], nil];
UIImageView *animation = [[UIImageView alloc] initWithFrame: CGRectMake(20, 10, 300, 80)];
animation.animationImages = imageArray;
animation.animationDuration = .8;
animation.contentMode = UIViewContentModeBottomLeft;
[self.view addSubview:animation];
[animation startAnimating];
[animation release];
[view release];
但是,如果我尝试使用setHidden或.hidden:是的,它似乎并没有隐瞒,喊道该动画没有声明。任何人都可以提出这个答案吗?当然,它盯着我打了一巴掌,但经过几个小时的尝试?现在我承认失败了。
什么时候你想让它消失?用户交互(手势,按钮,..)?时间?重复? – vikingosegundo 2010-08-19 19:38:41
基于用户通过按钮进行交互或基于nsuserdefault设置作为viewdidload的一部分调用方法。 – David26th 2010-08-19 19:52:10