iOS 7 UItableview单元格背景视图 [英] iOS 7 UItableview cell background view

查看:105
本文介绍了iOS 7 UItableview单元格背景视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用图像视图作为tableview单元格背景视图。当我在xcode 4.x中编译我的源时,它工作正常,即在iOS 6.x和7.0中它工作正常。但是当我在xcode 5.0中编译我的源代码时,背景图像视图没有出现在iOS 7中。

I am using a image view as tableview cell background view. When I am compiling my source in xcode 4.x, it works fine i.e, In both iOS 6.x and 7.0 it is working fine. But when I compile my source in xcode 5.0, the background image view is not appearing iOS 7.

任何想法,为什么它不起作用?在iOS 7中对uitableview单元格背景视图有任何限制吗?

Any idea, why it is not working? is there any restrictions on uitableview cell background view in iOS 7?

if (cell == nil) {
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:accountProfileTypeCell];
    UIImageView *cellBgView =[[UIImageView alloc]init];
    [cellBgView setImage:[UIImage imageNamed:@"cellBgView.png"]];
    [cell setBackgroundView:cellBgView];
}


推荐答案

尝试添加:cell.backgroundColor = [UIColor clearColor];

try adding : cell.backgroundColor = [UIColor clearColor];

这篇关于iOS 7 UItableview单元格背景视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆