設置顏色表中我知道如何設置顏色爲純表。 如果切換到組合表格,背景顏色也會移動並位於表格本身之外的背景中。 也可以設置顏色到表格。即一種顏色用於外部區域,另一種用於桌面?是否有可能在分組表
回答
這可以通過添加幾行代碼來完成。
對於使用圖像作爲背景,
tableView.opaque = NO;
[tableView setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"image.png"]]];
對於使用單一顏色,您可以使用,
tableView.opaque = NO;
[tableView setBackgroundColor:[UIColor blueColor]];
更多詳細信息,你可以看一下this tutorial。
真是太爽了,謝謝。 – 2012-02-02 09:35:38
將圖片設置爲背景時,就像兩張圖片。一個就像一個完整的背景,相同的圖像就像我的分組桌子周圍的框架,跟隨着scoll,但另一個背景是固定的。結果是帶有圖片的框架在相同的圖片背景下滑動,看起來有點奇怪。如果框架不在那裏,那將是完美的。你碰巧知道如何解決這個問題? – 2012-02-03 12:18:23
對於使用
[myTableView setBackgroundColor: [UIColor redColor]];
和內彩,可以設置將電池在UITableView的數據源的方法的背景顏色外的顏色可以通過界面生成器或通過代碼設置表背景色:
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString * CellIdentifier = @"customCell";
UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
cell.backgroundColor = [UIColor greenColor];
return cell;
}
謝謝,效果很好! – 2012-02-02 09:35:14
謝謝!如果您投票回答我的答案並將其選爲接受答案,我將不勝感激。這將有助於我們建立聲譽。 – 2012-02-02 10:14:06
現在我將你的答案標記爲一個有用的答案。你是這個意思嗎?? – 2012-02-02 11:48:51
- 1. 是否有可能檢索SQL結果分組爲列表
- 2. 是否有可能在BigQuery中使分區表非分區?
- 3. WPF Datagrid,是否有可能混合組和純(非分組)行?
- 4. 是否有可能進行分頁智能表
- 5. 是否有可能在Magento
- 6. 是否有可能在Symfony3
- 7. 是否有可能在Javascript
- 8. 是否有可能在Android
- 9. 是否有可能在.NET
- 10. 是否有可能在GSA
- 11. 是否有可能在widget.TextInputLayout
- 12. 是否有可能在iOS
- 13. 是否有可能在Ext.grid.column.Action
- 14. 是否有可能在android
- 15. 是否有可能在iPhone
- 16. 是否有可能在python
- 17. 是否有可能在Java
- 18. 是否有可能在WPF
- 19. 是否有可能在CMD.EXE
- 20. 是否有可能在
- 21. 是否有可能在android
- 22. 是否有可能在IDA
- 23. 是否有可能在GLSL
- 24. 是否有可能在android
- 25. 是否有可能在XSLT
- 26. 是否有可能在iPhone
- 27. 是否有可能在PhantomJS
- 28. 是否有可能在HAPIJS
- 29. 是否有可能改變.NET數組的分配方法?
- 30. 是否有可能知道查詢組件的各個分數?
看看這個以前SO質疑http://stackoverflow.com/questions/400965/how-to-customize-the-background-border-colors-of-a-grouped-table-view – visakh7 2012-02-02 08:17:56