我有一个添加 viewController 的 UITabBarController,但定位已关闭。屏幕顶部有大约 20px 的间隙,加载的 viewController 的底部是隐藏的。如何移动调整加载的 viewController 的大小?
viewController = [[FlashCardViewController alloc] initWithNibName:@"FlashCardViewController" bundle:[NSBundle mainBundle]];
viewController.view.bounds = [[UIScreen mainScreen]bounds];
//viewController.view.alpha = 0.0;
//[self.view addSubview:viewController.view];
tabBarController = [[UITabBarController alloc] initWithNibName:nil bundle:nil];
tabBarController.viewControllers = [NSArray arrayWithObject:viewController];
tabBarController.view.alpha = 0.0;
[self.view addSubview:tabBarController.view];
我尝试了这两种方法,但没有运气。
tabBarController.view.bounds = [[UIScreen mainScreen] bounds];
tabBarController.view.frame = [[UIScreen mainScreen] bounds];
无论如何,这并不是我真正想要做的。我想将它们设置为 tabBarController 查看窗口的大小和位置。