Closed CoderXSLee closed 1 year ago
func setupChild( title: String, image: String, selectedImage: String, vc: UIViewController.Type) { let item = ESTabBarItem.init(BouncesContentView(), title: title, image: UIImage(named: image), selectedImage: UIImage(named: selectedImage)) item.contentView?.renderingMode = .automatic let controller = UINavigationController(rootViewController: vc.init()) controller.tabBarItem = item addChild(controller) } 默认无选中item 执行 self.selectedIndex = 0 也无效 只有在ESTabBarController 82行断点的时候,查看self.tabBar 时是选中的,过了断点也就正常了,不打断点就不会选中! 为什么呢?
有没有大佬遇到过?
func setupChild( title: String, image: String, selectedImage: String, vc: UIViewController.Type) { let item = ESTabBarItem.init(BouncesContentView(), title: title, image: UIImage(named: image), selectedImage: UIImage(named: selectedImage)) item.contentView?.renderingMode = .automatic let controller = UINavigationController(rootViewController: vc.init()) controller.tabBarItem = item addChild(controller) } 默认无选中item 执行 self.selectedIndex = 0 也无效 只有在ESTabBarController 82行断点的时候,查看self.tabBar 时是选中的,过了断点也就正常了,不打断点就不会选中! 为什么呢?