圈框架iOS中的图像 [英] image in circle frame iOS

查看:157
本文介绍了圈框架iOS中的图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个联系人列表的uitableview。我希望将每个联系人的图像放在一个圆圈框架中,就像在小牛队的登录界面中一样。有关如何在uitableviewCell中执行此操作的任何建议吗?

i have uitableview with a list of contact. I would like to have the image of each contact in an circle frame like in the login screen of mavericks. Any suggestions how to do this in an uitableviewCell ?

推荐答案

我认为你的Cell中有你的imageView,所以你要做的就是同样的效果是使用不可见的边框。使用此代码可以产生这种效果:

I presume that you have your imageView inside your Cell, so what your have just to do for have the same effect is use a invisible border. Use this code for make this effect:

cell.yourImageView.layer.cornerRadius = cell.yourImageView.frame.size.height /2;
cell.yourImageView.layer.masksToBounds = YES;
cell.yourImageView.layer.borderWidth = 0;

您的UIImageView必须具有相同的高度和宽度,您还必须在项目中导入quartzCore框架

Your UIImageView must have the same height and width also you have to import the quartzCore framework in your project

这篇关于圈框架iOS中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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