一、UILabel
1.背景顏色? backgroundColor
2.文本內容顏色? textColor
3.內容? ? text
4.文本對齊方式? ? textAlignment? ? ? ? NSTextAlignmentCenter
5.字體大小? ? UIFont systemFontOfSize:20
6.行數? ? ? numberOfLines
7.自適應label尺寸? ? ? label sizeToFit
8.斷行模式? ? ? ? ? NSLineBreakByTruncatingMiddle
9.陰影顏色? ? ? ? ? ? shadowColor? ? ? ? UIColor whiteColor
10.陰影大小? ? ? shadowOffset? ? ? ? ? ? ? ? CGSizeMake(3, 2)
11.設置邊框? ? ? ? ? ? layer.borderWidth? ? ? ? ? ? 1
12.設置圓角? ? ? ? ? ? ? layer.cornerRadius? ? ? ? ? ? ? ? ? 6
13.抹除圓角多余背景色? ? ? ? layer.masksToBounds? ? YES
14.文本位置大小? ? ? label.frame? ? ? ? ? CGRectMake(100, 100, 200, 200)
15.修改視圖的位置? ? center? ? CGPointMake(400, 100)
二、UIView
屬性設置:
1.背景顏色? ? ? ? ? ? ? ? ? ? ? ? ? ? backgroundColor
2.透明度? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? alpha? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 0.5
3.位置大小? ? ? ? ? ? ? ? ? ? ? ? ? ? frame? ? ? ? ? ? ? CGRectMake(200, 200, 150, 150)
4.父視圖把視圖放在上面? ? bringSubviewToFront
5.父視圖把視圖放在下面? ? ? sendSubviewToBack
四、UIButton
屬性設置:
1.位置大小? ? ? ? ? ? ? frame
2.背景顏色? ? ? ? ? backgroundColor
3.標題? ? ? ? ? ? setTitle:? forState:? ? ? @“確認"? ? UIControlStateNormal
4.標題字體大小? ? ? titleLabel.font? ? UIFont systemFontOfSize:25
5.圓角? ? ? ? ? ? ? layer.cornerRadius? ? ? ? 10
6.邊框? ? ? ? ? layer.borderWidth? ? ? ? ? 1
7.點擊方法? addTarget:? action:? ? ? ? ? ? ? forControlEvents:
8.self? ? ? @selector(click:)? UIControlEventTouchUpInside
9.背景圖片? ? ? ? ? ? setBackgroundImage
五、UITextField
屬性設置:
1.背景顏色? ? ? ? backgroundColor? ? ? ? ? ? ? UIColor redColor
2.邊框? ? ? ? ? layer.borderWidth? ? ? ? ? ? 1
3.圓角? ? ? ? ? ? ? layer.cornerRadius? ? ? ? ? 5
4.文本內容? ? ? ? ? ? text? ? ? ? ? ? ? ? ? ? ? ? @"haha"
5.占位符? ? ? ? ? ? ? ? ? ? placeholder? ? ? ? ? ? ? ? ? @"占位字符"
6.文本顏色? ? ? ? ? ? ? textColor? ? ? ? ? ? ? ? ? ? UIColor redColor
7.文本位置? ? ? ? ? ? ? ? textAlignment? ? ? ? ? ? ? ? NSTextAlignmentCenter
8.密碼圓點? ? ? ? ? ? ? secureTextEntry? ? ? ? ? ? ? YES
9.鍵盤類型? ? ? ? ? ? ? ? keyboardType? ? ? ? ? ? ? ? UIKeyboardTypeNumberPad
10.return樣式? ? ? ? ? ? ? ? returnKeyType? ? ? ? ? ? ? ? UIReturnKeySearch
11.清除按鈕樣式? ? ? ? clearButtonMode? ? ? ? UITextFieldViewModeAlways