您的位置:首页 > 产品设计 > UI/UE

UITableViewCell的backgroundColor和backgroundView

2016-01-08 10:42 190 查看
// 设置普通背景
UIView *bg = [[UIView alloc] init];
bg.backgroundColor = [UIColor whiteColor];
self.backgroundView = bg;

// 设置选中时的背景
UIView *selectedBg = [[UIView alloc] init];
selectedBg.backgroundColor = MJColor(237, 233, 218);
self.selectedBackgroundView = selectedBg;
cell的backgroundView优先级>backgroundColor


//backgroundView 的优先级 >  backgroundColor
self.tableView.backgroundView = nil;
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg"]];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: