1.UIView  

// 如果userInteractionEnabled=NO,不能跟用户交互

@property(nonatomic,getter=isUserInteractionEnabled) BOOL userInteractionEnabled;

// 控件的标记(父控件通过标记可以找到对应的子控件)

@property(nonatomic) NSInteger tag;

// 控件的位置和尺寸(以父控件的左上角为坐标原点)

@property(nonatomic) CGRect            frame;

// 控件的位置和尺寸(以控件本身的左上角为坐标原点)

@property(nonatomic) CGRect            bounds;

// 控件的中点位置(以父控件的左上角为坐标原点)

@property(nonatomic) CGPoint           center;

// 形变属性:旋转、缩放、平移

@property(nonatomic) CGAffineTransform transform;

// 父控件

@property(nonatomic,readonly) UIView       *superview;

// 所有的子控件

@property(nonatomic,readonly,copy) NSArray *subviews;

2.UILabel  

// 显示的文字

@property(nonatomic,copy)   NSString           *text;

// 字体

@property(nonatomic,retain) UIFont             *font;

// 文字颜色

@property(nonatomic,retain) UIColor            *textColor;

// 文字的排列方式(左对齐、居中、右对齐)

@property(nonatomic)        NSTextAlignment    textAlignment;

// 设置行数(行数==0代表自动换行)

@property(nonatomic) NSInteger numberOfLines;

3.UIImageView  

// 显示的图片

@property(nonatomic,retain) UIImage *image;

// 设置序列帧图片数组(按顺序播放animationImages数组中的图片)

@property(nonatomic,copy) NSArray *animationImages;

// 序列帧动画的持续时间

@property(nonatomic) NSTimeInterval animationDuration;

// 序列帧动画的执行字数(默认是0,代表无限循环)

@property(nonatomic) NSInteger      animationRepeatCount;

4.UIScrollView  

// 表示UIScrollView所滚动的位置

@property(nonatomic) CGPoint contentOffset;

// 表示UIScrollView的内容尺寸(能滚动的范围)

@property(nonatomic)         CGSize                       contentSize;

// 增加UIScrollView额外的边缘滚动区域

@property(nonatomic)         UIEdgeInsets                 contentInset;

// 代理

@property(nonatomic,assign) id<UIScrollViewDelegate>      delegate;

5.UITableView  

(前几篇博客已经有很详细的属性介绍及使用) 需要查看的可以参考前几篇博客。

6.UIPickerView  

(前几篇博客已经有很详细的属性介绍及使用) 需要查看的可以参考前几篇博客。

7.UIControl  

// 是否可用

@property(nonatomic,getter=isEnabled) BOOL enabled;

// 自动拥有很多种状态

// 可以通过下面的方法来监听控件内部的一些事件:点击、值改变

- (void)addTarget:(id)target action:(SEL)action forControlEvents:(UIControlEvents)controlEvents;

1> UIDatePicker    

// 设置模式(类型)

@property(nonatomic) UIDatePickerMode datePickerMode;

// 设置区域(zh_CN代表天朝)

@property(nonatomic,retain) NSLocale      *locale;

// 设置当前时间

@property(nonatomic,retain) NSDate        *date;

// UIDatePicker内部显示的日期更改了,就会触发值改变事件

2> UISwitch

// 控制开关状态

@property(nonatomic,getter=isOn) BOOL on;

- (void)setOn:(BOOL)on animated:(BOOL)animated;

// UISwitch内部开关状态更改了,就会触发值改变事件

3> UISegmentControl  

// 一共有多少块区域

@property(nonatomic,readonly) NSUInteger numberOfSegments;

// 当前选中区域的位置

@property(nonatomic) NSInteger selectedSegmentIndex;

// UISegmentControl内部选中的区域更改了,就会触发值改变事件

4> UISlider  

// 设置当前的进度值

@property(nonatomic) float value;

// 设置最小的进度值

@property(nonatomic) float minimumValue;

// 设置最大的进度值

@property(nonatomic) float maximumValue;

// UISlider内部的进度值更改了,就会触发值改变事件

5> UIButton  

// 快速创建一个按钮

+ (id)buttonWithType:(UIButtonType)buttonType;

// 设置按钮的内边距

@property(nonatomic) UIEdgeInsets contentEdgeInsets;

// 按钮内部的标签控件

@property(nonatomic,readonly,retain) UILabel     *titleLabel;

// 按钮内部的图片控件

@property(nonatomic,readonly,retain) UIImageView *imageView;

// 设置内部titleLabel显示的文字

- (void)setTitle:(NSString *)title forState:(UIControlState)state;

// 设置内部titleLabel的文字颜色

- (void)setTitleColor:(UIColor *)color forState:(UIControlState)state;

// 设置内部imageView显示的图片

- (void)setImage:(UIImage *)image forState:(UIControlState)state;

// 设置背景图片

- (void)setBackgroundImage:(UIImage *)image forState:(UIControlState)state;

- (NSString *)titleForState:(UIControlState)state;

- (UIColor *)titleColorForState:(UIControlState)state;

- (UIImage *)imageForState:(UIControlState)state;

- (UIImage *)backgroundImageForState:(UIControlState)state;

6> UITextField(通过delegate监听内部的事件)  

8.UIAlertView  

// 创建一个UIAlertView对话框

/*

title : 对话框标题

message : 对话框中间显示的文字内容

cancelButtonTitle : 取消按钮的文字

otherButtonTitles : 其他按钮的文字(设置多个)

delegate : 用来监听alertView上面按钮的点击

*/

- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id /*<UIAlertViewDelegate>*/)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ... NS_REQUIRES_NIL_TERMINATION;

// 显示

- (void)show;

作者: 清澈Saup

出处:http://www.cnblogs.com/qingche/
本文版权归作者和博客园共有,欢迎转载,但必须保留此段声明,且在文章页面明显位置给出原文连接。 

iOS- <项目笔记>UI控件常见属性总结的更多相关文章

  1. iOS学习笔记——基础控件(上)

    本篇简单罗列一下一些常用的UI控件以及它们特有的属性,事件等等.由于是笔记,相比起来不会太详细 UIView 所有UI控件都继承于这个UIView,它所拥有的属性必是所有控件都拥有,这些属性都是控件最 ...

  2. ios 中的UI控件学习总结(1)

    UIKit框架提供了非常多功能强大又易用的UI控件 下面列举一些在开发中可能用得上的UI控件 UIButton 按钮 UILabel 文本标签 UITextField 文本输入框 UIImageVie ...

  3. UI控件tag属性和魔法数字的处理

    说明:tag属性有很大的用处,它就好像每个UI控件的id,当多个按钮指向同一个监听方法时,可以给方法带参数UIButton,然后根据不同的tag值 来判断执行哪个按钮的监听事件: - (IBActio ...

  4. ios 学习笔记之控件属性

    1.文本框 设置密码属性:Secure Text Entry 勾选; 设置文本框带清除属性: Clear Button =Is always visible;  默认是不带清除属性:Never app ...

  5. 初见IOS的UI之:UI控件的属性frame bounds center 和transform

    这些属性,内部都是结构体:CGRect CGPoint CGFloat 背景知识:所有的控件都是view的子类,屏幕就是一个大的view:每个view都有个viewController,它是view的 ...

  6. IOS 学习笔记(6) 控件 文本域(UITextField)的使用方法

    UITextField控件的诸多特性都和UITextView相似,比如成为输入文本焦点时键盘自动显示,支持长按弹出动作选项,能够接收输入事件(开始输入,修改内容,结束输入和点击回车等). 1.特有的特 ...

  7. ios开发中button控件的属性及常见问题

    最为最基本的控件,我们必须对button的每个常用属性都熟练应用: 1,使用之前,必须对按钮进行定义,为乐规范,在@interface ViewController (){}中进行定义,先定义后使用. ...

  8. IOS中调整UI控件位置和尺寸

    1.frame(修改位置和尺寸):以父控件左上角为坐标原点,在其父控件中的位置和尺寸. //frame属性中的坐标点不能直接修改 CGRect tempFrame = self.v.frame; // ...

  9. IOS 学习笔记(7) 控件 分隔栏控件(UISegmentControl)的使用方法

    分隔栏控件的系统默认式样一共有3种,分别是“普通式样”,"边框式样","条状式样" 分隔栏控件中有一个momentary属性,默认时NO.当开发者配置成YES时 ...

随机推荐

  1. python中for......else......的使用

    for x in range(5): if x == 2: print(x) # break else: print("执行else....") 上述代码:当缺少break关键字时 ...

  2. Android内存分析工具

    在Android系统开发过程中,经常会要去分析进程的内存的使用情况,简单介绍下Android内存分析的相关工具. 文章参考: 1.dumpsys 2.memory-analysis-command 1 ...

  3. python remove跟pop的区别

    remove根据值来删除 li=[1,2,3,4] li.pop[0] li.remove['] 或者是a=li[-1]li.remove(a) pop是根据索引来删除

  4. Goland的常用快捷键

    文件相关快捷键: CTRL+E,打开最近浏览过的文件. CTRL+SHIFT+E,打开最近更改的文件. CTRL+N,可以快速打开struct结构体. CTRL+SHIFT+N,可以快速打开文件. 代 ...

  5. JavaScript’s “this”: how it works, where it can trip you up

    JavaScript’s “this”: how it works, where it can trip you up http://speakingjs.com/es5/ch23.html#_ind ...

  6. 北京Uber优步司机奖励政策(9月14日~9月20日)

    滴快车单单2.5倍,注册地址:http://www.udache.com/ 如何注册Uber司机(全国版最新最详细注册流程)/月入2万/不用抢单:http://www.cnblogs.com/mfry ...

  7. 封装一个Automapper单例

    public class DataModule : IModule { public void Configure(IMapperConfigurationExpression cfg) { //cf ...

  8. SSM-Spring-23:概念《Spring中的事务是什么?》

    ------------吾亦无他,唯手熟尔,谦卑若愚,好学若饥------------- 本篇博客会详细讲述Spring中的事务,会展开来用语言解释,用于了解概念和准备面试 事务的概念: 一个或者一组 ...

  9. 转 Cobar使用文档(可用作MySQL大型集群解决方案)

    转自:http://blog.csdn.net/shagoo/article/details/8191346 最近好不容易抽空研究了下Cobar,感觉这个产品确实很不错(在文档方面比Amoeba强多了 ...

  10. jsp传递参数的四种方法

    1.form表单 2.request.setAttribute();和request.getAttribute(); 3.超链接:<a herf="index.jsp"?a= ...