Iphone UIImageView类问题
我拍摄了一个Imageview类,iam使用代码将图像添加到该类中: TileImageView*TileImageView=[[Tile alloc]initWithImage:TileImageView] 并像这样添加到视图中:[self.view insertSubview:tileImageView atIndex:0]Iphone UIImageView类问题,iphone,objective-c,Iphone,Objective C,我拍摄了一个Imageview类,iam使用代码将图像添加到该类中: TileImageView*TileImageView=[[Tile alloc]initWithImage:TileImageView] 并像这样添加到视图中:[self.view insertSubview:tileImageView atIndex:0] 因此,如何删除Imageview类并将新图像分配到该视图中UIView类中有一个标记属性,可用于以后检索视图 titleImageView.tag = 1; [sel
因此,如何删除Imageview类并将新图像分配到该视图中UIView类中有一个标记属性,可用于以后检索视图
titleImageView.tag = 1;
[self.view addSubview:titleImageView];
// later:
titleImageView = [self.view viewWithTag:1];
titleImage.view.image = otherImage;
或者,您可以将对图像视图的引用保存在实例变量中。甚至没有注意到这一点。非常悲哀:22个问题被问到,大多数都有答案,没有人接受答案——这是我以前从未见过的!