Pregunta

I have a toolbar, which I cannot to locate on the bottom of the screen…

toolbar = [[UIToolbar alloc] init];

[toolbar sizeToFit];

CGFloat toolbarHeight = [toolbar frame].size.height;
CGRect rootViewBounds = self.view.bounds;
CGFloat rootViewHeight = CGRectGetHeight(rootViewBounds);
CGFloat rootViewWidth = CGRectGetWidth(rootViewBounds);
CGRect rectArea = CGRectMake(0, rootViewHeight - toolbarHeight,rootViewWidth, toolbarHeight);

[toolbar setFrame:rectArea];

    [toolbar sizeToFit];

[self.view addSubview:toolbar];

…app is starts, everything is ok, but when I turn the iPad and changing the orientation of the device to portrait, my toolbar is stays higher, not on the bottom of the view.

¿Fue útil?

Solución

You should use Auto Layout in your nib

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top