Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

你好,请教一下,关于一个tableVIew中对不同类型的cell进行夜间模式背景颜色的设置 #107

Open
jniosdeveloper opened this issue Mar 10, 2018 · 0 comments

Comments

@jniosdeveloper
Copy link

请问下,我在tableView中设置两种类型的cell,设置的代码是一样的,但是为啥我切换到夜间模式的时候第二种类型的cell的背景颜色没有切换到夜间模式呢?
@Pickerify(SYMineOneCell, cellTintColor)
@Pickerify(SYMineTwoCell, twoCellTintColor)

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    if (indexPath.row == 0 || indexPath.row == 1 || indexPath.row == 4) {
        SYMineOneCell *oneCell = [tableView dequeueReusableCellWithIdentifier:SYMineOneCellID forIndexPath:indexPath];
        if (indexPath.row == 0) {
            oneCell.oneL.text = @"我的喜欢";
            oneCell.rightL.hidden = YES;
        }
        if (indexPath.row == 1) {
            oneCell.oneL.text = @"清除缓存";
            oneCell.rightL.hidden = NO;
            oneCell.rightL.text = [JNHelper sizeStr:self.totalSize];
        }
        if (indexPath.row == 4) {
            oneCell.oneL.text = @"关于";
            oneCell.rightL.hidden = YES;
        }
        oneCell.dk_cellTintColorPicker = DKColorPickerWithKey(BG);
        self.oneCell = oneCell;
        return oneCell;
    }
    SYMineTwoCell *twoCell = [tableView dequeueReusableCellWithIdentifier:SYMineTwoCellID forIndexPath:indexPath];
    if (indexPath.row == 2) {
        twoCell.oneL.text = @"夜间模式";
        [twoCell.rightSwitch addTarget:self action:@selector(clickNightModel:) forControlEvents:UIControlEventValueChanged];
    }
    if (indexPath.row == 3) {
        twoCell.oneL.text = @"推送消息";
    }
    twoCell.dk_twoCellTintColorPicker  = DKColorPickerWithKey(BG);
    return twoCell;
}

这个代码设置难道哪里不对吗?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant