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

----------------------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培训期待与您交流!----------------------

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值