您的位置:首页 > 产品设计 > UI/UE

类方法创建UIButton的类型

2016-06-13 00:00 302 查看
摘要: 你是否为创建一个圆角、+、!button而犯愁,其实你只是不知道UIButton的常见创建类型

UIButton *button=[[UIButton buttonWithType:(UIButtonType);

  能够定义的button类型有以下6种,

  UIButtonTypeCustom = 0, 自定义风格

  UIButtonTypeRoundedRect, 圆角矩形

  UIButtonTypeDetailDisclosure, 蓝色小箭头按钮,主要做详细说明用

  UIButtonTypeInfoLight, 亮色感叹号

  UIButtonTypeInfoDark, 暗色感叹号

  UIButtonTypeContactAdd, 十字加号按钮

看到这些,你一定会想以前用

btn.layer.cornerRadius = 5f;
btn.layer.masksToBounds = YES;

是多么费时不讨好了吧
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息