部分控件总结

控件总结

什么是控件 控件就是系统提供给我们的积木块,系统给我们提供的积 木块形状已经确定,必须遵守某种行为来使用。当然我们 也可以自己造积木块

UIView

所有能看的见的都是view

1) CGRect frame = {CGOrigin, CGSize}; CGOrigin = {x, y}; //

坐标是相对的 CGSize = {width, height};

2) CGPoint center = {x, y}; //view中点的坐标

3) CGRect bounds;

4) bringSubviewToFront: //把某个子控件置于顶层

5) view.tag [self.view viewWithTag: ] // 根据tag值, 得到

对应的view

6) view.clipsToBounds = YSE; // 自动剪裁掉超出本身frame大小

的子view的内容

7) view.contentMode // 内容填充模式

8) [UIView animateWithDuration: animations:^{ } completion:

^(BOOL finished){

UILabel

1) label.frame

2) label.text

3)

}];

// UIView动画

//CGRectMake(x, y, width, height); //label.textColor

//UIColor redColor colorWithRed: //UITextAlignmentCenter Left Right

label.backgroundColor green: blue: alpha:

4) label.textAlignment

5)

label.font //systemFontOfSize: boldSystemFontOfSize:

[UIFont fontWithName: size: ]

6) label.numberOfLines //默认是1,只显示一行,改为0多行显示5)

label.font //systemFontOfSize: boldSystemFontOfSize:

[UIFont fontWithName: size: ]

6) label.numberOfLines //默认是1,只显示一行,改为0多行显示

UIButton

继承自UIControl, UIControl是在UIView的基础上增加了注册事件的方法 addTarget(还有其它)

1) buttonWithType:

//类方法, UIButtonTypeRoundedRect, InfoLight, InfoDark,

ContactAdd, DetailDisclosure, Custom

2) setTitle: forState: //UIControlStateNormal, Highlighted 3) setTitleColor: forState:

4) addTarget:self action:@selector() forControlEvents: //注

册事件

5) setBackgroundImage: forState: 6) setImage: forState:


转载于:https://my.oschina.net/DolionHou/blog/643560

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值