image in circle frame iOS(圆形框架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中的图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:圆形框架iOS中的图像
基础教程推荐
- iOS4 创建后台定时器 2022-01-01
- NSString intValue 不能用于检索电话号码 2022-01-01
- 通过重定向链接在 Google Play 中打开应用 2022-01-01
- AdMob 广告未在模拟器中显示 2022-01-01
- 如何从 logcat 中删除旧数据? 2022-01-01
- navigator.geolocation.getCurrentPosition 在 Android 浏览器上 2022-01-01
- iPhone - 获取给定地点/时区的当前日期和时间并将其与同一地点的另一个日期/时间进行比较的正确方法 2022-01-01
- Cocos2d iPhone 非矩形精灵触摸检测 2022-01-01
- Android:getLastKnownLocation(LocationManager.NETWORK_PROVIDER 2022-01-01
- libGDX 从精灵或纹理中获取像素颜色 2022-01-01
