iphone - what determines the initial value of CALayer.position? -


i have simple test app has 1 view, 1 view controller, , of instantiated via standard storyboard. when run app , pause on breakpoint in view controller can see following values set on view:

self.view.layer.position = (cgpoint) (x=160, y=294) self.view.layer.frame = (cgrect) (origin=(x=0, y=20) size=(width=320, height=548)) self.view.layer.visiblerect = (cgrect) (origin=(x=0, y=0) size=(width=320, height=548)) 

i understand initial origin value frame (assuming value of 20 offset status bar), 160/294 value coming layer's position? i'm baffled one.

this because calayer's position property relative anchorpoint. default, anchorpoint set (0.5, 0.5), represents center of layer's bounds.

if you're trying perform basic positioning changes programmatically, i'd stay away view's layer property, since uiview has positioning properties of own.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -