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

给TableView设置背景图片

2015-05-28 23:03 302 查看
UIImage *image = [UIImage imageNamed:@”1.jpg”];

UIImageView *imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];

// 将图片视图加到视图上

[self addSubview:imageView];

imageView.userInteractionEnabled = YES;

self.myTabelView.alpha = 0.5;

// 将tableView加到图片视图上

[imageView addSubview:self.myTabelView];

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// 在这个方法里面设置cell的透明度


cell.backgroundColor = [UIColor colorWithRed:123.0 / 255.0 green:23.0 / 255.0 blue:45 / 255.0 alpha:0.1];

return cell;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息