문제

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.

도움이 되었습니까?

해결책

You should use Auto Layout in your nib

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top