iOS 13 中的 UITableViewCell 重新排序控件剪辑视图
UITableViewCell reorder control clips view in iOS 13
我在 UITableViewCell 中放置了一张背景图片,以使其更具视觉吸引力。在iOS 13中,背景图像被重新排序控件裁剪。
OS 的旧版本不会发生这种情况。
代码很简单:
// Put a border around mBackgroundImage. Make it slightly smaller than the size of the cell so that the border doesn't run all the way to the edges.
cell.mBackgroundImage.frame = CGRectMake(2, 2, cell.frame.size.width-4, cell.frame.size.height-4);
cell.mBackgroundImage.layer.cornerRadius = 4;
cell.mBackgroundImage.layer.borderColor = [UIColor colorWithWhite:0.92 alpha:1.0].CGColor;
cell.mBackgroundImage.layer.borderWidth = 1;
cell.mBackgroundImage.layer.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:0.95 alpha:1.0].CGColor;
有什么建议吗?
通过将 cell.contentView.clipsToBounds 设置为否解决了问题。看起来 cell.contentView.clipsToBounds=YES 在 iOS 13.
之前被忽略了
我在 UITableViewCell 中放置了一张背景图片,以使其更具视觉吸引力。在iOS 13中,背景图像被重新排序控件裁剪。
OS 的旧版本不会发生这种情况。
代码很简单:
// Put a border around mBackgroundImage. Make it slightly smaller than the size of the cell so that the border doesn't run all the way to the edges.
cell.mBackgroundImage.frame = CGRectMake(2, 2, cell.frame.size.width-4, cell.frame.size.height-4);
cell.mBackgroundImage.layer.cornerRadius = 4;
cell.mBackgroundImage.layer.borderColor = [UIColor colorWithWhite:0.92 alpha:1.0].CGColor;
cell.mBackgroundImage.layer.borderWidth = 1;
cell.mBackgroundImage.layer.backgroundColor = [UIColor colorWithRed:1.0 green:1.0 blue:0.95 alpha:1.0].CGColor;
有什么建议吗?
通过将 cell.contentView.clipsToBounds 设置为否解决了问题。看起来 cell.contentView.clipsToBounds=YES 在 iOS 13.
之前被忽略了