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

查看:15
本文介绍了圆形框架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天全站免登陆