UIButton 圆角 边框颜色 字体大小 文字对齐 图片大小
UIButton UIButton 其实包含 UIImageView 和 UILabel 两个控件,UIButton继承于UIControl,所以有addtarget监听事件 //inherits from: UIControl : UIView : UIResponder : NSObject 1、类型: //初始化一个按钮对象 // 创建 圆角矩形 的按钮 UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // button 类型 有以下 6 种, // typedef enum { // UIButtonTypeCustom = 0, 自定义风格 // UIButtonTypeRoundedRect, 圆角矩形 // UIButtonTypeDetailDisclosure, 蓝色小箭头按钮,主要做详细说明用 // UIButtonTypeInfoLight, 亮色感叹号 // UIButtonTypeInfoDark, 暗色感叹号 // UIButtonTypeContactAdd, 十字加号按钮 // } UIButtonType; 2、位置 //设置 button在 view 上的 位置、尺寸 button1.frame = CGRectMake(20, 20, 280, 20)