ios - Bounds vs Frame when making a custom view and initializing it -


i'm having difficulties understanding difference, , when use what.

i know textbook definitions. have searched lot regarding topic. answers here on helpful extent, feel still don't understand properly.

let's have acustomview.m, , when place ui elements within view, use bounds, makes sense because it's in it's own coordinate system, but, when initialize view using initwithframe: in view-controller, should use self.view.frame or self.view.bounds? both work, different results.

i want understand this, appreciated.

the bounds of uiview rectangle, expressed location (x,y) , size (width,height) relative own coordinate system (0,0).

the frame of uiview rectangle, expressed location (x,y) , size (width,height) relative superview contained within.

so difference question of representation.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -