控件总结动画
什么是控件 控件就是系统提供给咱们的积木块,系统给咱们提供的积 木块形状已经肯定,必须遵照某种行为来使用。固然咱们 也能够本身造积木块orm
UIView继承
全部能看的见的都是view事件
1) CGRect frame = {CGOrigin, CGSize}; CGOrigin = {x, y}; //ip
坐标是相对的 CGSize = {width, height};get
2) CGPoint center = {x, y}; //view中点的坐标animation
3) CGRect bounds;it
4) bringSubviewToFront: //把某个子控件置于顶层io
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: