2014-04-30 74 views
0

我試圖分配「圖像」「按鈕」,但原因「圖像」不加載。的iOS UIButton的不加載圖像

UIImage *bottonImage = [UIImage imageNamed:@"bocinaMute.png"]; 

    [self.botton.imageView setImage:[UIImage imageNamed:@"mute.png"]]; 

當我在控制檯打印出來的imageView的值是:

po _botton.imageView 
<UIImageView: 0x15f53a390; frame = (0 0; 0 0); clipsToBounds = YES; hidden = YES; opaque = NO; userInteractionEnabled = NO; layer = <CALayer: 0x170235c20>> 

我在做什麼錯?

回答

5

使用:

[btnTwo setImage:[UIImage imageNamed:@"mute.png"] forState:UIControlStateNormal]; 

代替

[self.botton.imageView setImage:[UIImage imageNamed:@"mute.png"]];