Swift facebook messenger用户照片

问题描述:

我正在尝试创建像facebook messager聊天页面那样的用户列表。Swift facebook messenger用户照片

我可以创建用户并将它们放入tableview。一切工作正常,但我dıd不会使像附加文件的照片。

我可以创建圆形按钮,但不能给一个空的地方,并把标志放在这个空的区域。

enter image description here

您可以通过以下下面做步骤 1)取一个的UIButton中的UITableViewCell。 2)在其上设置图像。 3)以编程方式设置圆角半径并在UIButton上绘制白色边框。

这里是第3步

self.btnRound.layer.cornerRadius = 15 //btnRound.frame.size.width/2 
self.btnRound.clipsToBounds = true 
btnRound.layer.borderWidth = 2.0 
btnRound.layer.borderColor = UIColor.whiteColor().CGColor 

enter image description here

在这里,我已经把UIButton的上右上角的代码。基于需求,你需要放在右下角。

+0

在你的样品绿色检查图像和火箭是1图像? 如果是,这对我来说不起作用,因为我的图像是动态的 – John

+0

没有两者是分开的。我已经使用UIButton作为绿色图像。从开始阅读我的答案。我也提到了一些步骤。 – kb920