[英]iphone:how to set table background Image
我嘗試作為第一個將圖像視圖作為表格視圖的背景並選擇圖像。然后我將在視圖中執行以下代碼:
table.backgroundColor = [UIColor clearColor];
並清除自定義單元格標簽。但是它與表格值重疊。
這對我有用
UIImageView *tempImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];
[tempImg setImage:[UIImage imageNamed:@"IMG_0071.JPG"]];
[testTableView setBackgroundView:tempImg];
您需要在UIImageView上使用透明的UITableView。 將您的圖像放入圖像視圖中,即可根據需要看起來像表格的背景圖像
您可能想嘗試將UIImage放在UITableView后面。在視圖上使用方法insertView:atIndex:
另外,您可能想看一下Matt Gallagher 撰寫的本教程http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
您必須清除tableviewcell背景色。 您必須在return cell;
之前編寫此代碼return cell;
聲明。
cell.backgroundColor = [UIColor clearColor];
以及表格單元格標簽的顏色。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.