В моем Ios приложении я создаю UIImageViews программно как то,как изменить UIImageView изображения в программном
for (int i=0; i<20; i++) {
productID=[products objectAtIndex:i];
UIButton * button = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[button setFrame:CGRectMake(column*197+38 , row*350+8, 159, 45)];
//[button setImage:redButtonImage forState:UIControlStateNormal];
[button addTarget:self
action:@selector(buttonAction:)
forControlEvents:UIControlEventTouchUpInside];
button.tag = productID;
[scrollView addSubview:button];
UIImageView *imageView = [[UIImageView alloc]initWithFrame:CGRectMake(column*197+170, row*350+25, 13, 13)];
imageView.tag=productID;
UIImage *image = [UIImage imageNamed:@"redImage.png"];
[imageView setImage:image];
[scrollView addSubview:imageView];
}
в моем buttonActon, я хочу изменить изображение, которое UIImageView на другое изображение. Но я не могу этого сделать. Может кто-нибудь мне помочь? Спасибо.
Вы не можете этого сделать, потому что? [Что вы пробовали?] (Http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Pfitz