我有一个IBOutlet UIButton,我添加到IB中的滚动视图。我将其类型设置为自定义,然后在viewDidLoad中我有:
[self.featuredButton setImage:[UIImage imageNamed:@"featuredNormal.png"] forState:UIControlStateNormal];
[self.featuredButton setImage:[UIImage imageNamed:@"featuredSelected.png"] forState:UIControlStateSelected];
图片没有出现......为什么不呢?
答案 0 :(得分:0)
使用
[self.featuredButton setBackgroundImage:[UIImage imageNamed:@"featuredNormal.png"] forState:UIControlStateNormal];
[self.featuredButton setBackgroundImage:[UIImage imageNamed:@"featuredSelected.png"] forState:UIControlStateSelected];