2010-03-25 36 views
0

我想有一个背景图像一个UITableView分组的UITableView是否将其backgroundColor赋予其单元格?

想象一下,你刚才任何分组表初始化是这样的:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {  

// Override point for customization after application launch 
ImageTableViewController *vc = [[ImageTableViewController alloc] initWithStyle:UITableViewStyleGrouped]; 


NSString *imagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"BackgroundImage.jpg"]; 
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:imagePath] autorelease]; 
vc.tableView.backgroundColor = [UIColor colorWithPatternImage:image]; 

[window addSubview:vc.view]; 
    [window makeKeyAndVisible]; 

return YES; 
} 

这导致的tableView具有backgrounImage,而且具有最低的每一个细胞图像的一部分。

我想这是事实,因为UITableViewCell应该和UITableView具有相同的backgroundColor。它对颜色有好处,但与图像情况完全不同。

有没有办法告诉UITableViewCell不要使用这个图像?

回答

0

倍率的tableView:willDisplayCell:forRowAtIndexPath:并给电池用透明背景

+0

我需要设置的区域的背景中的圆角的矩形的外部。 backgroundColor属性正在处理它内部的区域。 – Tomen 2010-03-25 13:25:21

+0

对不起 - 我想:有没有办法告诉UITableViewCell不要使用这个图像 - 意味着你想摆脱单元格中的图像 – ManniAT 2010-03-26 12:06:45

相关问题