Preview rounded image in iphone

戏子无情 提交于 2019-12-04 10:54:00

Sure. Add the QuartzCore framework to your project, then:

#import <QuartzCore/QuartzCore.h>
// ...
cell.imageView.layer.masksToBounds = YES;
cell.imageView.layer.cornerRadius = 4;

Note that the cornerRadius property is only available in OS 3.0 and later; if you're supporting an older version (which you probably don't have to be), you'll need to do some Core Graphics work.

will creating an image in an image editor and then setting it as the cell's background not work?

This might be useful for you http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html

If your image is in an image view and you're targeting OS 3.0+, you can set imageView.layer.cornerRadius.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!