I have a View with UINavigationBar:
AppDelegate
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
_homeScreen = [[PrepareScreen alloc] init];
self.mainViewController = [[MyViewController alloc] initWithScreenDef:[self.homeScreen projectHomeScreen] AndBounds:self.window.bounds];
self.navigationController = [[UINavigationController alloc] initWithRootViewController:self.mainViewController];
self.window.rootViewController = self.navigationController;
[self.window makeKeyAndVisible];
return YES;
And then I have a class
MyViewController : UIView <UITableViewDataSource,UITableViewDelegate>
And in my .h file , I have:
- (void)viewDidLoad
{
[super viewDidLoad];
self.myTableView = [[UITableView alloc] initWithFrame:self.view.bounds];
[self.view addSubview:self.myTableView];
}
After that, I have the wrong screen height. I want my myTableView to have size.height-49.0
source
share