UIButton使用方法汇总
来源:互联网 发布:mac dance with me 编辑:程序博客网 时间:2024/06/06 15:40
UIButton使用方法汇总
原文链接地址:http://blog.sina.com.cn/s/blog_bf9843bf0101f8hr.html
//按钮初始化类方法
UIButton
//按钮初始化实例方法
UIButton *button1=[[UIButton alloc]initWithFrame:CGRectMake(50, 300, 200, 50)];
//
//
//
//
//
//
//
//
//给定button在view上的位置
[button1 setFrame:CGRectMake(50, 300, 200, 50)];
button1.frame=CGRectMake(50, 300, 200, 50);
//button背景色
[button1 setBackgroundColor:[UIColor redColor]];
button1.backgroundColor=[UIColor redColor];
//设置button填充图片
//[button1
//设置button标题
[button1
//以下是几种状态
//
//
//
//
//
//
//
//
注意:
button1.adjustsImageWhenHighligh
//跟上面的情况一样,默认情况下,当按钮禁用的时候,图像会被画得深一点,设置NO可以取消设置
button1.adjustsImageWhenDisabled
//下面的这个属性设置为yes的状态下,按钮按下会发光
button1.showsTouchWhenHighlighte
按下按钮,并且手指离开屏幕的时候触发这个事件,跟web中的click事件一样。
触发了这个事件以后,执行butClick:这个方法,addTarget:self
也可以传入其他类的指针
[button1
//显示控件
[self.view
注意:
[button1
addTarget:self
action:@selector(alarmTimeDone:)
forControlEvents:UIControlEventTouchUpIns
//取消按钮已经添加的所有事件:(这个比较重要,若添加了两个事件
[btn
何时释放release
是否在dealloc中对UIButton对象进行release操作,取决于UIButton初始化的方式。
如果使用 [UIButtonbuttonWithType:UIButtonTypeRoundedRect]这种方式,是不需要进行release操作的,因为这种方式是自动释放的。如果使用
- UIButton使用方法汇总
- UIButton使用方法汇总
- UIButton使用方法汇总
- UIButton基本使用方法
- UIButton 使用方法心得总结
- UIButton的一些使用方法
- iOS--UIButton的使用方法
- UIButton使用汇总
- UIButton使用汇总
- UIView,UILabel,UITextField,UIButton使用方法
- iOS--UIButton的使用方法详细
- IOS--UIButton的使用方法详细
- iOS UILabel UIButton UIImageView使用方法
- iOS开发中UIButton的使用方法总结
- CSDN Blog使用方法汇总
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- symbian字体使用方法汇总
- android通过webservice进行网络编程,使用工具类实现
- 程序员技术练级
- Effective C++ 条款5——了解C++默默编写并调用哪些函数
- 修改tomcat默认路径
- 利用js简单实现图片的放大缩小功能
- UIButton使用方法汇总
- UITextField用法总汇 (转载)
- 把tomcat中的webapps移走
- Ogre源代码浅析——脚本及其解析(一)
- 一道题弄明白二维数组的指针
- Ogre源代码浅析——脚本及其解析(二)
- OpenGL的数据类型 与 C中数据类型对应
- Uva 12124 Assemble
- 使用nexus创建私服