在下图中,如何将 View 右侧按钮的颜色更改为白色?编辑:理想情况下只希望某些单元格为白色,其他单元格为黑色 这是我的代码:
cell.backgroundColor = .appOrange
cell.contentLabel.textColor = .white
cell.numberLabel.textColor = .white
cell.tintColor = .white //this appears to do nothing, just something I tried
最佳答案
在 iOS13.x 中,重新排序控件的颜色似乎取决于亮/暗模式(之前它被设置为与背景形成对比,现在它看起来是固定的,具体取决于模式)。
因此,可以通过 UITableViewCell 的 overrideUserInterfaceStyle
来切换重新排序控件的颜色。
默认 - 在手机的灯光模式下,我几乎看不到控件:
正在申请
- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
SelectableCell *cell = [tableView dequeueReusableCellWithIdentifier:@"selectableCell"];
...
cell.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;
return cell;
}
给出如下结果:
关于ios - 在表格 View 单元格中更改重新排序控件的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45967210/