惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
月光博客
月光博客
有赞技术团队
有赞技术团队
阮一峰的网络日志
阮一峰的网络日志
Last Week in AI
Last Week in AI
G
Google Developers Blog
腾讯CDC
B
Blog
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
人人都是产品经理
人人都是产品经理
博客园_首页
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI

博客园 - Clark Chan

『iOS小案例』 类型转换失败(use of undeclared identifier) 『iOS学习笔记』 - 变量 属性 方法 实现 『iOS学习笔记』 - Hello Word 博文阅读密码验证 - 博客园 C#-计算相对路径 - Clark Chan - 博客园 【原创源码】(05):C#-计算绝对路径。 - Clark Chan - 博客园 Windows Vista 睡眠后鼠标死机几分钟 bat批处理文件的执行过程有趣 Windows XP 文件删除之后在回收站找不到文件 Windows XP 从“我的电脑”删除共享文档: Windows XP KB913433补丁(FlashPlayer)无法安装的解决办法 Windows XP 回收站已损坏的解决办法 TreeView右键选中节点。 XmlTextWriter.WriteString与WriteRaw的区别 字符串转换成枚举值 转载:MDA的一些资源的连接 转载:模型驱动架构 C#生成Xml字符串 [转载][求助]在C#中调用JetCar.Netscape的问题?
『iOS学习笔记』 UIButton-1
Clark Chan · 2012-05-18 · via 博客园 - Clark Chan

『iOS学习笔记』 UIButton-1

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