0
我在我的表视图中有一些uiButtons,我想加载它们与我从数组中获得的图像。但我无法使用数组将图像添加到按钮,并且它正在崩溃我的整个应用程序。任何人都可以提供我解决方案如何添加图像按钮在桌面视图使用数组Images.Any帮助将不胜感激。将图像阵列添加到UIbuttons
这种方法是从一个循环,我传递一个按钮作为参数
-(void)setImage1:(UIButton *)button
UIButton *newButton=[[UIButton alloc]init];
newButton=button;
[newButton setImage:[NSString stringWithFormat:@"%d.png", j] forState:UIControlStateNormal]; j++; }
感谢, 克里斯蒂称为
这是一个按钮 – Christina 2011-06-15 10:28:06
再次向我们展示一些代码,以便我们更好地理解。我不明白你想要做什么,但对我来说这似乎是一个非常容易的问题。 – darksky 2011-06-15 10:29:29
- (无效)setImage1:(的UIImageView *)的ImageView { \t \t \t的UIButton * newButton = [[UIButton的页头] INIT]; \t newButton = button; \t \t \t \t // [newButton setImage:[的NSString stringWithFormat:@ “%d.png”,j]的forState:UIControlStateNormal]; \t j ++; \t } – Christina 2011-06-15 10:31:21