1.按钮种类
typedef enum {
UIButtonTypeCustom = 0, // 没有风格
UIButtonTypeRoundedRect, // 圆角风格按钮
UIButtonTypeDetailDisclosure, //
UIButtonTypeInfoLight, // 明亮背景的信息按钮
UIButtonTypeInfoDark, // 黑暗背景的信息按钮
UIButtonTypeContactAdd, //
} UIButtonType;
2.按钮状态:
UIControlEventTouchDown // 按下
UIControlEventTouchDownRepeat // 多次按下
UIControlEventTouchDragInside // 保持按下然后在按钮及其一定的外围拖动
UIControlEventTouchDragOutside // 保持按下,在按钮外面拖动
UIControlEventTouchDragEnter // DragOutside进入DragInside触发
UIControlEventTouchDragExit // in到out触发
UIControlEventTouchUpInside // 在按钮及其一定外围内松开
UIControlEventTouchUpOutside // 按钮外面松开
UIControlEventTouchCancel // 点击取消
3.得到当前状态
currentTitle property // 当前按钮上显示的标题(只读),当按钮状态改变时值自动改变.值可以为nil.
currentTitleColor property // 当前标题颜色(只读).此值要保证不为nil,默认是白色.
currentTitleShadowColor property // 标题的阴影颜色(只读).默认是白色.
currentImage property // 当前按钮上的图片(只读).可以是nil.
currentBackgroundImage property // 当前按钮背景图片(只读).可以是nil.
imageView property // 按钮上的图片视图(只读).虽然它是只读的,但是他的属性是可读写的.imageView的属性在按钮还没有显示前就有值了.系统按钮这些值是nil
4.得到尺寸
– backgroundRectForBounds: // 返回背景绘制区域.
– contentRectForBounds: // 返回内容绘制区域.内容区域是显示图片和标题及他们特定对齐缩放等的范围.
– titleRectForContentRect: // 返回标题的绘制区域.
– imageRectForContentRect: // 返回图片的绘制区域.
阅读(303) | 评论(0) | 转发(0) |