簡體   English   中英

如何自定義TTTableViewCell的背景色? (Three20框架)

[英]How to customize the background color of a TTTableViewCell? (Three20 framework)

我試圖自定義TTTableViewCell的背景顏色,但沒有成功。

我的TableViewController中有以下方法,當用戶單擊單元格時將執行以下方法:

- (void)didSelectObject:(id)object atIndexPath:(NSIndexPath*)indexPath {
TTTableViewCell* cell = (TTTableViewCell*) [self.tableView cellForRowAtIndexPath:indexPath];
cell.contentView.backgroundColor = [UIColor redColor];}

我也嘗試過

cell.backgroundColor = [UIColor redColor];

但仍然無法正常工作。 有任何想法嗎?

編輯:我的錯,它正在工作。 我在頂部渲染了一些東西,但看不到它。

我想你想要這個:

cell.backgroundColor = [UIColor redColor];

是否有可能在單元格頂部渲染了沒有[UIColor clearColor]作為背景色的內容?

編輯:剛剛看到您的編輯...很顯然...;)

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM