2010-03-25 63 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

相關問題