【简单常用】button
来源:互联网 发布:万方专利数据库 编辑:程序博客网 时间:2024/05/09 23:42
UIButton *button1 = [UIButtonbuttonWithType:UIButtonTypeSystem];
//UIButtonTypeCustom 自定义风格(无边框的那种)默认
//UIButtonTypeSystem 圆角
button1.frame =CGRectMake(100,100,50,50);
[button1 setTitle:@"BTN1"forState:UIControlStateNormal];//样式
[button1 setTitleColor:[UIColorredColor] forState:UIControlStateNormal];
button1.titleLabel.textColor=[UIColor yellowColor]; //字体颜色,同上
button1.titleLabel.textAlignment=NSTextAlignmentRight; //对齐方式靠右
button1.titleLabel.font=[UIFontboldSystemFontOfSize:16]; //字体加粗16
//点击事件
[button1 addTarget:selfaction:@selector(qh)forControlEvents:UIControlEventTouchUpInside];
[button1 setTitleShadowColor:[UIColorgrayColor] forState:UIControlStateNormal];//阴影
//高亮时的 图片
[button1 setBackgroundImage:[UIImageimageNamed:@"P"]forState:UIControlStateHighlighted];
//内容到边缘距离(上左下右)
button1.contentEdgeInsets =UIEdgeInsetsMake(0,10,0,0);
button1.titleEdgeInsets=UIEdgeInsetsMake(0,10,0,0);
button1.imageEdgeInsets=UIEdgeInsetsMake(0,10,0,0);
//图片随按钮高亮而高亮,默认YES
button1.adjustsImageWhenHighlighted =NO;
//图片随按钮失效而变暗,默认YES
button1.adjustsImageWhenDisabled=NO;
//按下会有白色光点,默认NO
button1.showsTouchWhenHighlighted=YES;
- 【简单常用】button
- Button常用处理
- css 常用的button
- Button 常用事件
- Android Button常用属性
- 2.常用控件:Button
- Flat Button简单制作
- Flat Button简单制作
- Flat Button简单制作
- Button的简单封装
- Button简单使用
- Button和Button事件的简单应用
- ext.button 常用 函数 属性
- 常用控件 01 按钮 Button
- [android]控件Button常用属性
- button按钮常用样式设计
- 常用的event.button事件
- 常用到的Button链接
- Redis 日志收集系统高可用搭建
- 02 Web Host方式寄宿WebAPI
- GPG安装和使用(免费加密)
- java抽象类和接口的区别,使用场景
- O(n)时间效率寻找字符串中第一次出现一次的字符
- 【简单常用】button
- gpg的使用
- Sicily 14256. Pseudo Semiprime
- SQL server数据导入Mysql中
- poj 1026 Cipher (置换群)
- public abstract void onItemSelected (AdapterView<?> arg0, View arg1, int arg2, long arg3)
- 接口与抽象类
- Redis 3.0介绍及集群说明
- 全排列算法