可以给tableview添加一个背景图片吗?? 可以给tableview添加一个背景图片吗?? 如何添加 求代码!!!!~ 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 UITableView 是从 UIView 继承下来的,可以试试直接设置 backgroundColor。从图片创建一个 UIColor,使用 Pattern 方式初始化。另外,就是在下面增加一层图片,将表格的背景色设置为透明。 最好重写 这个函数-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ cell.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"58rowWrap.png"]]; //cell的背景图 cell.textLabel.backgroundColor = [UIColor clearColor];} 看错了 以为是给cell添加背景图 给tableView 直接这样UIImageView *tableBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XXX.png"]]; [yourTable setBackgroundView:tableBg]; [tableBg release]; 楼上的好熟练啊,能问下搞iPhone多就了么? 我学iPhone一个星期 another way....1) place the background image first and then place the tableview on view; 2) code : set tableView.backgroundColor = [UIColor cleanColor]; you will see the background image now... 1,直接修改UITableView的背景View,并且将cell背景设为透明2,自定义cell3,自定义或修改UITableView类…… 可以的,什么view都可以加背景 self.tableView.backgroundColor=[UIColor clearColor]; UIImageView *imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"home_bg.png"]]; [self.tableView setBackgroundView:imageview]; [imageview release]; IOS 页面跳转出现的问题 关于iphone后台下载的问题 弹出view .net转ios开发,公司需要没办法,希望有人能把经验分享一下,谢谢csdn平台! ipad 64位 运行sqlite查询返回sqlite_error itmsservices协议 protobuf 怎么在iOS中实用?求解! xCode提示函数重定义 建没有故事板和xib的工程怎么选? javascript调用obj-c一般采用什么方法? iphone新手看过来 关于XCode版本和sqlite3 的问题,,急,谢谢
另外,就是在下面增加一层图片,将表格的背景色设置为透明。
-(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{ cell.backgroundView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"58rowWrap.png"]]; //cell的背景图
cell.textLabel.backgroundColor = [UIColor clearColor];
}
给tableView 直接这样UIImageView *tableBg = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"XXX.png"]];
[yourTable setBackgroundView:tableBg];
[tableBg release];
2) code : set tableView.backgroundColor = [UIColor cleanColor]; you will see the background image now...
2,自定义cell
3,自定义或修改UITableView类……
UIImageView *imageview = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"home_bg.png"]];
[self.tableView setBackgroundView:imageview];
[imageview release];