控件總結動畫
什麼是控件 控件就是系統提供給咱們的積木塊,系統給咱們提供的積 木塊形狀已經肯定,必須遵照某種行爲來使用。固然咱們 也能夠本身造積木塊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: