开发者

what would cause x: and y: values to be off in the Interface Builder?

a noob question here.

I have a very strange situation that's very puzzling to me. I am setting up my labels and textfields in a prepareScreen method

example for Portrait:

titleLabel.frame = CGR开发者_如何学编程ectMake(107,45,105,29);

and the same label in Landscape:

titleLabel.frame = CGRectMake(187,0,105,29);

I got these values after I initially created the layout in the Interface Builder many versions and builds ago. So today, I wanted to change the layout slightly only to find the Interface Builder reporting very weird X: and Y: numbers for all objects.

For example for the titleLabel.frames mentioned above it shows: X:159 and Y: 59 for Portrait and X:239 and Y: 14 for Landscape.

and when I manually move the label into the Top Left corner it shows X:52 and Y:14 values. For a different label, the difference is different. For some its off by X:5 and Y:8 and for some by X:67 and Y:15. Looks like the bigger the object, the bigger the difference. What would cause the Interface Builder to behave like this ? What's happening here ? Any ideas ?

thank you!


it was the anchor that was set incorrectly. the credit goes to Allara and I will gladly change the answer to Allara's, once its created. I just don't want to leave this question opened and unanswered, since I already got what I was looking for.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜