480

Frame & Bounds 這二個小東西一開始認識它們的時候,非常容易搞錯。一直以為是雙胞胎兄弟(啊…其實也像是啦…)
雖然很像但是不一樣,在官方的文件中是這樣寫的:
Frame
The frame rectangle, which describes the view’s location and size in its superview’s coordinate system.
Bounds
The bounds rectangle, which describes the view’s location and size in its own coordinate system.
兩者的差別,也就是對應的坐標系統不同
Frame對應的是父視窗的坐標系統
Bounds對應的是本身的坐標系統

假設 A的大小為 120×75,在此圖片中A的Frame與Bounds分別為
Frame:(100,150,120,75)
Bounds:(0,0,120,75)