【发布时间】:2013-02-17 21:13:49
【问题描述】:
在我的应用程序中,我有一种方法 loadImage。
loadImage 方法用于将新图像添加到 imageView。
-(void)loadimage:(int)index
{
ImageView = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width*index, 0, self.view.frame.size.width, self.view.frame.size.height-88)]; // -88(Upper+Lower)
NSString *imageNameStr = [NSString stringWithFormat:@"%@",[arrImages objectAtIndex:index]];
ImageView.image=[UIImage imageNamed:imageNameStr];
[ScrollView addSubview:ImageView];
}
添加图像后,我想删除旧图像。
removeImage 方法用于从 imageView 中删除旧图像。
如何创建 removeImages 方法来删除选定的图像?
【问题讨论】:
-
如果
[arrImages objectAtIndex:index]已经是NSString(我想是),那你为什么还要对+ [NSString stringWithFormat:]添加另一个调用?
标签: ios cocoa-touch imageview