1

我有一个 IBOutlet UIButton 添加到 IB 的滚动视图中。我将其类型设置为自定义,然后在 viewDidLoad 我有:

[self.featuredButton setImage:[UIImage imageNamed:@"featuredNormal.png"] forState:UIControlStateNormal];
[self.featuredButton setImage:[UIImage imageNamed:@"featuredSelected.png"] forState:UIControlStateSelected];

图像没有出现...为什么不呢?

4

1 回答 1

0

利用

[self.featuredButton setBackgroundImage:[UIImage imageNamed:@"featuredNormal.png"] forState:UIControlStateNormal];

[self.featuredButton setBackgroundImage:[UIImage imageNamed:@"featuredSelected.png"] forState:UIControlStateSelected];
于 2013-01-17T19:44:20.727 回答