【发布时间】:2013-09-28 06:46:32
【问题描述】:
我使用图像视图作为表格视图单元格背景视图。当我在 xcode 4.x 中编译我的源代码时,它运行良好,即在 iOS 6.x 和 7.0 中它运行良好。但是当我在 xcode 5.0 中编译我的源代码时,背景图像视图没有出现在 iOS 7 中。
任何想法,为什么它不起作用? iOS 7 中的 uitableview 单元格背景视图有什么限制吗?
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:accountProfileTypeCell];
UIImageView *cellBgView =[[UIImageView alloc]init];
[cellBgView setImage:[UIImage imageNamed:@"cellBgView.png"]];
[cell setBackgroundView:cellBgView];
}
【问题讨论】:
-
你是如何设置背景的?显示您正在使用的实际代码。
-
我已经添加了代码。谢谢
-
[UIImage imageImaged: ] imageImaged 不是 UIImage 类中的任何方法。它的-imageNamed。请在您的代码中编辑它
-
对不起,我在粘贴这段代码时犯了这个错误,但我在 xcode 中正确编写了代码
-
你可以尝试添加:cell.backgroundColor = [UIColor clearColor];
标签: iphone ios objective-c ios7