表視圖,我可以顯示在表視圖小圖像,但我想加載PNG作爲我的表視圖中的每個細胞的BG如何做到這一點如何插入PNG圖片中的iPhone
cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil && searching==NO) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
//cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
/*
UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:@"Live and LearnCell" ofType:@"png"]];
cell.image = img;
*/
//// FISRTS LABEL
cell.imageView.image = [UIImage imageNamed:@"TopCell.png"];
mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(70.0, 5.0, 220.0, 15.0)] autorelease];
mainLabel.tag = MAINLABEL_TAG;
// mainLabel.font = [UIFont systemFontOfSize:14.0];
[mainLabel setFont:[UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]];
mainLabel.textAlignment = UITextAlignmentLeft;
mainLabel.textColor = [UIColor whiteColor];
mainLabel.highlightedTextColor = [UIColor greenColor];
//mainLabel.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
[cell.contentView addSubview:mainLabel];
}
如何添加PNG作爲BG到這個單元格?
非常感謝; 0 – ram 2010-07-26 09:43:25
嘿如果我必須合併2圖像讓我們說只有1個單元格的頂部和底部圖像??? – ram 2010-07-26 09:46:45
用特定的詳細信息打開一個新問題。 – 2010-07-26 10:05:45