在iphone中为图像添加边框 [英] Add border to a image in iphone

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

问题描述

我在自定义单元格中有一个图像。是否有任何API为图像添加灰色边框?

I have an image in a custom cell. Is there any api to add a gray border to an image?

提前致谢!

推荐答案

你可以试试这个

[imageView.layer setBorderColor: [[UIColor blackColor] CGColor]];
[imageView.layer setBorderWidth: 2.0];

为此您需要导入< QuartzCore / QuartzCore.h>

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

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