按钮方法示例代码
2013-10-17 11:19
176 查看
接着前篇的按钮控件方法的实现
1.UIButton * button =[UIButton
buttonwithType:UIButtonTypeRoundRect];
//圆角
2.button.frame=CGRectMake(坐标x,坐标y,按钮长度w,按钮高度h);
//位置设定
3.[Button SetTitle:@"按钮"
forState:UIControlStateNormal];
//正常状态
4.[Button SetTitle:@"按钮按下"
forState:UIControlStateHighligted];
//高亮状态
5.[button addTarget:self
action:@"selector"(buttonAction)
forControlEvents:UIControlEventTouchUpinside];
6.[button setTitleColor
:[UIColor blackColor]
forState:UIControlStateNomal];
7.button.titlelabel.font:[UIfont
systemfontofsize:14];
1.UIButton * button =[UIButton
buttonwithType:UIButtonTypeRoundRect];
//圆角
2.button.frame=CGRectMake(坐标x,坐标y,按钮长度w,按钮高度h);
//位置设定
3.[Button SetTitle:@"按钮"
forState:UIControlStateNormal];
//正常状态
4.[Button SetTitle:@"按钮按下"
forState:UIControlStateHighligted];
//高亮状态
5.[button addTarget:self
action:@"selector"(buttonAction)
forControlEvents:UIControlEventTouchUpinside];
6.[button setTitleColor
:[UIColor blackColor]
forState:UIControlStateNomal];
7.button.titlelabel.font:[UIfont
systemfontofsize:14];
相关文章推荐
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。 2014-07-04 13:17 78人阅读 评论(0) 收藏
- php生成缩略图质量较差解决方法代码示例
- 下面的示例演示如何使用传递到事件处理方法的 GridViewCommandEventArgs 对象确定引发事件的按钮的命令名。
- 设计模式之工厂方法模式及代码示例
- OC-UI-004.纯代码编写按钮的简单方法
- struts2示例代码-对Action所有方法或指定方法校验(手写方法)
- 使用AngularJS编写多选按钮选中时触发指定方法的指令代码详解
- css美化input file按钮的代码方法
- Qt QSortFilterProxyModel示例代码, 使用方法
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- Java压缩文件工具类ZipUtil使用方法代码示例
- asp.net后台cs中的JSON格式变量在前台Js中调用方法(前后台示例代码)
- Android中ImageButton自定义按钮的按下效果的代码实现方法,附网上2种经典解决方法。
- Control Study -> 自定义DataGrid翻页按钮(示例代码下载)
- 在javascript中执行任意html代码的方法示例解读
- Java生成随机数的2种示例方法代码
- pcm转wav的方法及代码示例
- Java编程实现获取当前代码行行号的方法示例
- JavaScript用JQuery呼叫Server端方法示例代码