首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Iphone >

iphone 自定义色彩的 圆角矩形

2012-06-26 
iphone 自定义颜色的 圆角矩形首先选择button的type为customer然后设置背景色这个时候会发现界面显示的是

iphone 自定义颜色的 圆角矩形

首先选择button的type为customer

然后设置背景色

这个时候会发现界面显示的是直角矩形

此时在界面代码的界面初始化方法中 增加此矩形的圆角设置

first of all import this in your .m file -

#import <QuartzCore/QuartzCore.h>

and then in your?loadView?method add following lines

? ? yourButton.layer.cornerRadius = 10; // this value vary as per your desire? ? yourButton.clipsToBounds = YES;

热点排行