频道栏目
首页 > 资讯 > IOS > 正文

iphone开发 UIButton使用

11-12-20        来源:[db:作者]  
收藏   我要投稿

UIButton状态:
UIControlStateNormal          // 正常状态  
UIControlStateHighlighted     // 高亮状态  
UIControlStateDisabled        // 禁用状态   
UIControlStateSelected        // 选中状态   
UIControlStateApplication     //    
UIControlStateReserved        // 保留状态
 
UIButton类型:
UIButtonTypeCustom            //自定义类型

  

添加图片: 

灰色背景颜色:

UIButtonTypeRoundedRect       //圆角类型


 UIButtonTypeDetailDisclosure   //细节展示按钮

UIButtonTypeInfoLight          //浅色背景的信息按钮

UIButtonTypeInfoDark           //暗色背景的信息按钮

UIButtonTypeContactAdd         // 添加按钮 www.2cto.com

创建UIButton 1. UIButton *button = [[UIButton alloc] initWithFrame: CGRectMake (x, y, Width, Height)];      2. UIButton *button = [[UIButton buttonWithType:UIButtonTypeCustom] retain];    设置UIButton标题 [button setTitle:title forState:UIControlStateNormal];      设置UIButton标题颜色 [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];   设置UIButton背景图片 [button setBackgroundImage:newImage forState:UIControlStateNormal];   设置UIButton背景颜色 button.backgroundColor = [UIColor clearColor];

摘自 decemberd的专栏

     

相关TAG标签
上一篇:android应用开发之利用SAX、DOM和Pull实现对XML文件的解析并进行单元测试
下一篇:iphone开发 UIActionSheet(操作表) 和UIAlertView(警告)的用法
相关文章
图文推荐

关于我们 | 联系我们 | 广告服务 | 投资合作 | 版权申明 | 在线帮助 | 网站地图 | 作品发布 | Vip技术培训 | 举报中心

版权所有: 红黑联盟--致力于做实用的IT技术学习网站