导航、Tabbar、tableview配合使用时,tableview会出现错位的情况,特别是除tabbar的第一个选项的tableview,
解决方法非常简单,如下:
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.edgesForExtendedLayout = UIRectEdgeNone;//防止tableview错位
_tabBarControllerNav = [[UINavigationController alloc] initWithRootViewController:self.tabBarController];
_tabBarController.delegate = self;
self.window.rootViewController = _tabBarControllerNav;
本文介绍了一个解决在iOS应用中导航、Tabbar和tableview配合使用时,tableview可能出现错位情况的方法。通过设置UITabBarController的edgesForExtendedLayout属性为UIRectEdgeNone,可以避免这种情况发生。具体实现步骤和原理解释都在文中详细阐述。
2745

被折叠的 条评论
为什么被折叠?



