@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

UIButton
  1. 常规创建方法
UIButton *btn = [[UIButton alloc]init];
UIButton *btn = [[UIButton alloc] initWithFrame:<#(CGRect)#>];
  1. 常用方法:UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];//自定义按钮
UIButtonTypeSystem    //系统风格
UIButtonTypeDetailDisclosure  //它表明当前项目还有额外的细节和相关功能,点击后会在另一个表格或视图中呈现。
UIButtonTypeInfoLight, 
UIButtonTypeInfoDark,// 它表明app的配置细节入口,新页面有时候出现在当前视图的背面
UIButtonTypeContactAdd,//蓝色加号(+)按钮,可以放在任何文字旁  
  1. [button setTitle:@"BTN1" forState: UIControlStateNormal];//设置按钮的标题,forstate代表按钮状态,UIControlStateNormal(常态)、UIControlStateHighlighted(高亮)、UIControlStateSelected(选中),对于任何特定状态下的按钮,都可以设定该按钮该状态下的按钮标题。用setTitle 方法 设置即可
  2. [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];//设置指定状态下,标题文字颜色
  3. [button setImage:[UIImage imageNamed:@"a.png"] forState:UIControlStateNormal];//设置某状态下的按钮图片,[UIImage imageNamed:@"a.png"]表示以图片的名字获取图片
  4. [button setBackgroundImage:[UIImage imageNamed:@"1.png"] forState:UIControlStateNormal];//设置背景图片
  5. [button setBackgroundColor:[UIColor whiteColor]];//设置背景色(不常用)
  6. button.titleLabel.font = [UIFont systemFontOfSize:12];//设置标题字体大小
  7. [ button addTarget:self action: @selector (pressed)  forControlEvents:UIControlEventTouchUpInside];//添加触发事件及方法
 

@import url(http://i.cnblogs.com/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

UI UIBUTTON的更多相关文章

  1. cocos2d(3.0)一些基础的东西

    1.创建项目后环境配置: 附加文件夹:加入 $(EngineRoot) $(EngineRoot)cocos $(EngineRoot)cocos\editor-support $(EngineRoo ...

  2. GUI动态创建button

    #include "cocos2d.h" #include "cocos-ext.h" USING_NS_CC; USING_NS_CC_EXT; using ...

  3. iOS中 语音识别功能/语音转文字教程详解 韩俊强的博客

    每日更新关注:http://weibo.com/hanjunqiang  新浪微博 原文地址:http://blog.csdn.net/qq_31810357/article/details/5111 ...

  4. iOS中 语音识别功能/语音转文字教程具体解释 韩俊强的博客

    原文地址:http://blog.csdn.net/qq_31810357/article/details/51111702 前言:近期研究了一下语音识别,从百度语音识别到讯飞语音识别:首先说一下个人 ...

  5. iOS开发——UI基础-UIButton、UIImageView、UILabel的选择

    1.UILabel - UILabel的常见属性 @property(nonatomic,copy) NSString *text; 显示的文字 @property(nonatomic,retain) ...

  6. IOS开发UI基础之UIButton

    什么是按钮?

  7. iOS学习——UI基础UIButton(七)

    前面写了UIWindow.UIViewController,那些都是一些框架,框架需要填充上具体的view才能组成我们的应用,移动应用开发中UI占了很大一部分,最基础的UI实现是使用系统提供的各种控件 ...

  8. UI基础UIButton

    UI基础UIButton 前面写了UIWindow.UIViewController,那些都是一些框架,框架需要填充上具体的view才能组成我们的应用,移动应用开发中UI占了很大一部分,最基础的UI实 ...

  9. 【iOS 开发】基本 UI 控件详解 (UIButton | UITextField | UITextView | UISwitch)

    博客地址 : http://blog.csdn.net/shulianghan/article/details/50051499 ; 一. UI 控件简介 1. UI 控件分类 UI 控件分类 : 活 ...

随机推荐

  1. ADB server didn't ACK * failed to start daemon *

    问题描述:在eclipse的Logcat出现错误 [2014-01-08 14:00:07 - adb] ADB server didn't ACK [2014-01-08 14:00:07 - ad ...

  2. Handler 、 Looper 、Message

    分析: Looper:prepare和loop public static final void prepare() { if (sThreadLocal.get() != null) { throw ...

  3. hdu 4401 Battery

    这里只给出代码,感兴趣的可以作以参考: #include <algorithm> #include <cstdio> #include <cstring> #inc ...

  4. easyUI 操作

    <a href="javascript:void(0)" onclick="locationUrl()">点击 自动加链接</a> fu ...

  5. linux开发摘要

    1.linux内核文档链接点击打开链接 2.配置文件 在out\target\product\project\obj\KERNEL_OBJ\.config中可以看到 # CONFIG_MTD_LPDD ...

  6. 非root用户安装软件

    下面简要说一下Linux下非root用户安装软件的一般流程: 1. 获取源代码,一般是wget方式,ubuntu可以使用apt-get source来获取源代码. 2. 解压源代码,一般使用tar - ...

  7. 自定义样式 实现文件控件input[type='file']

    一般我们设计的上传按钮都是和整个页面风格相似的样式,不会使用html原生态的上传按钮,但是怎么既自定义自己的样式,又能使用file控件功能呢? 思路是这样的: 1.定义一个相对定位的DIV,按照整成步 ...

  8. HTML转义字符大全

    ISO Latin-1字符集:  — 制表符Horizontal tab  — 换行Line feed  — 回车Carriage Return  — Space ! ! — 惊叹号Exclamati ...

  9. iOS - QRCode 二维码

    1.QRCode 在 iOS7 以前,在 iOS 中实现二维码和条形码扫描,我们所知的有,两大开源组件 ZBar 与 ZXing. 这两大组件我们都有用过,这里总结下各自的缺点: 1.ZBar 在扫描 ...

  10. ES6 对象增强和结构赋值

    The enhanced Object literals: ES6 has added some new syntax-based extensions to {} object literal fo ...