gpt4 book ai didi

具有透明背景的iOS 8重新排序控件

转载 作者:行者123 更新时间:2023-11-29 02:20:03 24 4
gpt4 key购买 nike

在新的 iOS 8 中,在移动时重新排序控制透明背景。我没有对 tableview 做任何花哨的事情,只是将 indentWhileEditing 设置为 false 并将编辑样式设置为 none。我的 tableview 有透明背景,tableview 后面是带有图像的 imageview。如何为重新排序控件设置背景,使其不透明?

最佳答案

重新排序控件由 accessoryView 中的 UITableView 自动定位,直接来自文档:

The reordering control is gray, multiple horizontal bar control on the right side of the cell. Users can drag this control to reorder the cell within the table. The default value is NO. If the value is YES , the reordering control temporarily replaces any accessory view.

不幸的是,没有公共(public) API 来自定义重新排序控件本身。但是,由于您只想修改 accessoryView 的 backgroundColor,因此最好的办法是修改单元格背景。像这样:

- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
cell.backgroundColor = yourColor;
}

关于具有透明背景的iOS 8重新排序控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28255051/

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