Issue with frame size of UIView
I'm working on an iPad project, currently it's on Landscape view. And I tried doing:
self.view.frame.size.height
Why is this always returning 960? While as in landscape the height dimension of the view itself should be 768 right?
What I am trying to do is to allocInitWithFrame a UIToolbar that is located at the bottom. The UIToolBar has a height of 50, so here's what 开发者_运维技巧I did which failed:
self.bottom_bar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, self.frame.size.height-50, self.view.frame.size.width, 50)];
Why is this and how do I do this?
Two postings (one and two) referenced a similar problem. They both suggest using self.view.bounds instead of self.view.frame.size.width because the bounds change along with the interface orientation.
精彩评论