您的位置:首页 > 产品设计 > UI/UE

黑马程序员—iOS- <项目笔记>UI控件常见属性总结(上)

2014-12-18 15:05 501 查看
----------------------java培训Android培训IOS培训.Net培训期待与您交流!----------------------


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;


----------------------java培训Android培训IOS培训.Net培训期待与您交流!----------------------
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: