I mean There is bar with titl开发者_如何学Pythone in the center and close button in the left side and another button on the right side. Is it possible to place that bar in the center of the screen horizontally ?? Like that bar will take care of the screen below it and will not care about the content above it .
There are a couple of approaches you can take (the numbers I am using are just approximate so that you can get an idea):
Create a navbar in the center of the screen
CGRect frame = CGRectMake(0.0, 250.0, 320.0, 40.0);
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:frame];
But this is the preferred way:
Create a navigation controller occupying the bottom half of the screen
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:yourViewController];
navController.view.frame = CGRectMake(0.0, 250.0, 320.0, 230.0);
[self.window addSubview:navController.view];
精彩评论