ITeye博客

lefthand0302

lefthand0302 · 共 1 篇文章

UIButton,设置为UIButtonTypeCustom类型时,做圆角效果

我是ios开发新手。 今天遇到一个问题,想要将UIButton设置背景色,结果发现只有将Type设置为UIButtonTypeCustom时,背景色才起作用。 但是此时,圆角效果却木有了……。网上搜索了半天,基本上都说通过layer的几个方法设置,但是copy代码后报错“Receivertype 'CALayer'forinstance message is a forward declaration”。 最后从一个老外的帖子里找到答案: Add QuartzCore.framework to your project and this line to your .m file. **<sp…

2012-08-23 15:35 · IOS · 评论(0)