Z UITableViewCell中的图像索引和分隔符 [英] Z Index of image and separator in UITableViewCell

查看:123
本文介绍了Z UITableViewCell中的图像索引和分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个UITableViewCell,其图像部分位于单元格之外。见附件。

I have a UITableViewCell that has an image that sits partly outside the cell. See attached.

但是,分隔线覆盖图像。有没有办法摆脱那个分隔线?我找到的最好的是关闭所有tableviewcell分隔符,但我不想这样做,因为它与UI混淆。我希望能够调整UIImageView z-index或tableviewcell分隔符z-index。

However, the separator line is covering the image. Is there a way to get rid of that separator line? The best I found is turning off all the tableviewcell separators, but I don't want to do that since it messes with the UI. I'd like to be able to adjust the UIImageView z-index or the tableviewcell separator z-index.

我试过 [self bringSubviewToFront:self .overflowImageView]; UITableViewCell 上,但这并没有改变任何东西。

I tried [self bringSubviewToFront:self.overflowImageView]; on the UITableViewCell but that doesn't change anything.

即使我可以将分隔符的宽度更改为1px,我也没关系,但看起来你无法更改顶部的分隔符或查看桌面底部。

Even if I could change the width of the separator to 1px, I'd be okay with that, but it seems like you can't change the separators on top and or bottom of the tableview.

任何人都有关于如何将图像放在单元格上方的想法?

Anyone have ideas on how to get the image above the cell?

推荐答案

您可以使用 setZPosition 更改 UIView 图层z顺序。它适用于从 UIVIew 继承的所有对象。可能是一个错误, bringSubviewToFront 不适用于它所假设的所有情况。

You can change UIView layer z-order with using setZPosition. It is applied to all objects inherited from UIVIew. May be is it a bug, bringSubviewToFront not working for all cases as it suppose to.

[yourView.layer setZPosition:10];

数字越高优先级越高。

Higher the number higher priority.

这篇关于Z UITableViewCell中的图像索引和分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆