I have a UIView of size width=320px height=40px which I want to display at the bottom looking like a tab-bar.
I use the following code to accomplish this and it works fine on iPhone. But when I try the iPad simulator, the view does not appear anywhere on the screen.
buttonsView.frame=CGRectMake(
0,
self.view.frame.size.height - buttonsView.frame.size.height,
self.view.frame.size.width,
buttonsView.frame.size.height );
This stretches the view to the width of the screen but keeps it's original height.
How can I make this show right on my iPad also?
[UPDATE]
This happens in my viewDidLoad
.
I have this NSLog now:
NSLog(@"buttonsView Width: \t%g\t%g\tHeight:\t%g\t%g",self.view.frame.size.width, buttonsView.frame.size.width, self.view.frame.size.height, buttonsView.frame.size.height);
With output:
iPhone:
buttonsView Width: 320 320 Height: 460 40
iPad:
buttonsView Width: 768 768 Height: 1004 40
I also create another view like this for the top of the page which works fine:
dataView.frame=CGRectMake(
0,
0,
self.view.frame.size.width,
dataView.frame.size.height);
init
,viewDidLoad
,viewWillAppear
, etc? – Kevin