iOS Property List and Views学习笔记(Lesson 5)
来源:互联网 发布:淘宝店铺扣48分 编辑:程序博客网 时间:2024/06/16 20:54
斯坦福课程(Developing iOS 8 Apps with Swift),lesson 5
1、CGFloat: Always use this instead ofDouble or Float for anything to do with a UIView's coordinate system.
可以与Float,Double转换:varcfg = CGFloat(aDouble)
2、NSString is bridged to String.(String is struct )
NSArray is bridged to Array<Anyobject>
NSDictionary is bridged toDictionary<NSObject, Anyobject>
3、Property List is really just thedefinition of a term.
4、A view, a subclass of the class UIViewin iOS represents a rectangular area on the screen.
5、A UIViews' initializer is different ifit comes out of a storyboard.
Init(frame: CGRect) //initializer if the UIView is created in code
Init(coder: NSCoder) //initializer if the UIView comes out of astoryboard
6、If you need an initializer, implementthem both
Implement T:
func setup() {…}
override init(frame: CGRect) {
super.init(frame: frame)
setup()
}
required override init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
setup()
}
7、 Origin is upper left.
Units are points, not pixels.
Most of the time there are 2 pixels per point, but it could be only1 or something else
How many pixels per point are there? UIView's var contentScalaFactor: CGFloat
It will return the number of pixels per point.
8、 frame and center, which are aboutposition, bounce which is your size and area that you're drawing into your owncoordinate system. (frame center 用来定位视图的, bounds 用来在视图自身的坐标系中确定大小和区域的)
- iOS Property List and Views学习笔记(Lesson 5)
- ios 学习笔记之property
- ios Input Views and Input Accessory Views
- Pro Android学习笔记(一四一):List Widgets(3):Remote views Service和Factory
- Objective-C 学习笔记 08 - Property List
- swift 学习笔记 UITableView (一)Table View Styles and Accessory Views
- ArcGIS api for JavaScript 4.3 学习笔记(1)Mapping and views
- WTL 学习笔记 -- Property Sheets and Wizards
- WTL 学习笔记 -- Property Sheets and Wizards
- 斯坦福大学公开课 iOS应用开发教程学习笔记(第九课)Table Views
- iOS开发学习笔记 (一)表视图基础 Table Views
- IOS - Property list
- List and Map 学习笔记
- Java SE 学习笔记 Lesson 5
- struts2学习笔记(lesson 1)
- Double-buffered tree and list views
- IOS深入学习(28)之Property list(属性列表文件)
- iOS应用开发视频教程笔记(九)Table Views
- Linux内核工程导论——进程社会学
- javasscript 基础类型-- 笔记1
- Linux命令——alias
- <HTML5秘籍>——第6章(美妙的CSS3字体和特效)
- [leetcode 112]Path Sum
- iOS Property List and Views学习笔记(Lesson 5)
- leetcode-Majority Element
- java基础之求质数练习
- B站小爬虫
- 1017. Queueing at Bank (25)
- Shader 学习笔记 20151104
- Linux命令——unalias
- 转载
- Mac androidstudio 快捷键