如何访问iOS6中的子视图

时间:2012-10-23 06:55:17

标签: ios6

我在我的ViewController中动态创建子视图,如下所示:

CGRect imageFrame = CGRectMake(0.0, 0.0, 1024.0, 748.0);
UIImageView *backgroundImage = [[UIImageView alloc] initWithImage:bgImage];
backgroundImage.frame = imageFrame;
[self.view addSubview:backgroundImage];

(基本上,我在我的视图中添加了各种子视图,它们是不同类型内容的容器。)

我现在正在寻找一种正确的方法,以便稍后访问这些子视图,例如把它们淡出来。 有没有办法用标识符添加这些子视图,所以我可以直接调用它们?

1 个答案:

答案 0 :(得分:1)

UIView的标签属性怎么样?