【发布时间】:2012-05-08 01:52:09
【问题描述】:
我正在尝试在后台已经有 UIImageView 的单元格中添加 UIButton。
我把这段代码放在configureCell
UIButton *mail = [[UIButton alloc] initWithFrame:CGRectMake(10, 270, 40, 40)];
[mail setImage:[UIImage imageNamed:@"mail.png"] forState:UIControlStateNormal];
mail.backgroundColor = [UIColor whiteColor];
[mail addTarget:self action:@selector(sendMail) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:mail];
它可以工作,但 UIButton 中的图像看起来更暗
我尝试了这些,但没有任何改变
mail.alpha = 1;
[cell.contentView bringSubviewToFront:mail];
有没有人对此有解释,以及解决方案。
【问题讨论】:
标签: objective-c uiimageview uibutton