『iOS学习笔记』 UIButton-1
2012-05-18 16:49
561 查看
『iOS学习笔记』 UIButton-1
UIButton
UIButton
/// UIButton //创建UIButton UIButton *tmpButton =[[[UIButton alloc] init]autorelease]; //设置背景颜色 tmpButton.backgroundColor = [UIColor blueColor]; //设置标题文本 [tmpButton setTitle:@"MyButton" forState:UIControlStateNormal]; //设置标题文本的颜色 [tmpButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; //设置图片 UIImage *image3=[UIImage imageNamed:@"a3.png"]; [tmpButton setImage:image3 forState:UIControlStateNormal]; //设置位置和大小 tmpButton.frame = CGRectMake(0, 0, 200, 0);//在这里仅Width有效 //向容器中添加UIButton
相关文章推荐
- iOS学习笔记(七)——UI基础UIButton
- 暑期留校之iOS学习笔记_ UiButton
- 【iOS学习笔记】代码实现常用控件UIButton、UISlider、UISwitch、UISegmentedControl
- iOS学习笔记(七)——UI基础UIButton
- IOS入门学习笔记(普通UI控件--UIButton)
- IOS学习笔记(三)之UIButton
- iOS学习笔记(3)UIButton
- 【iOS学习笔记 15-12-19】自定义cell侧滑按钮(UIButton)
- IOS开发学习笔记(2)-----UIButton 详解
- IOS开发学习笔记024-UIButton和UIImageView的区别
- ios 学习笔记(8) 控件 按钮(UIButton)的使用方法
- IOS学习笔记(7)UIButton UIImageView UIScrollView UIWebView
- iOS学习笔记(29) 爱不释手的ReactiveCocoa之UIButton
- iOS学习笔记 4 —— 代码创建界面UIView、UILabel、UITextField、UIButton
- IOS学习笔记---UIKit之UIButton
- IOS学习笔记(7)UIButton UIImageView UIScrollView UIWebView
- ios学习笔记:设置UIButton的文字显示位置、字体的大小、字体的颜色
- IOS开发学习笔记(2)-----UIButton 详解(原创)
- iOS学习笔记-009.UIButton的常用属性
- iOS开发学习笔记之UIButton的使用