gpt4 book ai didi

ios - 在表格 View 单元格中更改重新排序控件的颜色

转载 作者:搜寻专家 更新时间:2023-10-31 22:10:54 24 4
gpt4 key购买 nike

在下图中,如何将 View 右侧按钮的颜色更改为白色?编辑:理想情况下只希望某些单元格为白色,其他单元格为黑色 这是我的代码:

cell.backgroundColor = .appOrange
cell.contentLabel.textColor = .white
cell.numberLabel.textColor = .white
cell.tintColor = .white //this appears to do nothing, just something I tried

enter image description here

最佳答案

在 iOS13.x 中,重新排序控件的颜色似乎取决于亮/暗模式(之前它被设置为与背景形成对比,现在它看起来是固定的,具体取决于模式)。因此,可以通过 UITableViewCell 的 overrideUserInterfaceStyle 来切换重新排序控件的颜色。

默认 - 在手机的灯光模式下,我几乎看不到控件:

Default - in the light mode of the phone I get practically invisible controls

正在申请

- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
...
SelectableCell *cell = [tableView dequeueReusableCellWithIdentifier:@"selectableCell"];
...
cell.overrideUserInterfaceStyle = UIUserInterfaceStyleDark;

return cell;
}

给出如下结果:

Overriding - UI style

关于ios - 在表格 View 单元格中更改重新排序控件的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45967210/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com