簡體   English   中英

自定義單元格-更改自定義單元格中背景和按鈕的顏色

[英]Custom Cell - Change color of background and button in custom cell

我在iterfacebuilder中創建了一個自定義單元,並連接到我的.h文件。

然后在我的CustomCell.m文件中

@implementation TwoMealsTableViewCell

@synthesize dayLabel, firstMealBtn, secondMealBtn, indexPath;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];

    dayLabel.textColor = [UIColor orangeColor];

    if (self) {

        dayLabel.textColor = [UIColor orangeColor];


    }

    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end

我已經在表格視圖中設置了所有單元格,並且看到了按鈕和標簽,但是沒有看到顏色變化嗎?

為什么是這樣。

我在這里先向您的幫助表示感謝!!!

這將改變單元格的顏色

dayLabel.textColor = [UIColor orangeColor];

暫無
暫無

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

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