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中的图像


- android 4中的android RadioButton问题 2022-01-01
- Android - 拆分 Drawable 2022-01-01
- Android viewpager检测滑动超出范围 2022-01-01
- 想使用ViewPager,无法识别android.support.*? 2022-01-01
- 如何检查发送到 Android 应用程序的 Firebase 消息的传递状态? 2022-01-01
- 在测试浓缩咖啡时,Android设备不会在屏幕上启动活动 2022-01-01
- MalformedJsonException:在第1行第1列路径中使用JsonReader.setLenient(True)接受格式错误的JSON 2022-01-01
- 使用自定义动画时在 iOS9 上忽略 edgesForExtendedLayout 2022-01-01
- Android - 我如何找出用户有多少未读电子邮件? 2022-01-01
- 用 Swift 实现 UITextFieldDelegate 2022-01-01