我需要访问tableview实例,该实例在扩展UITabeBarController的主类中有超过5个tabbars(其中tabBarItem" more"出现)时自动生成。我想稍微自定义tableview如何删除分隔符行(tableView.separatorStyle = .none
)。
由于
答案 0 :(得分:1)
夫特
let tab = UITabBarController()
if let viewController = tab.moreNavigationController.viewControllers.first as? UIViewController, let tableview = viewController.view as? UITableView {
tableview.separatorStyle = .none
}
ObjC
UITabBarController *tab = [UITabBarController new];
UIViewController *vc = [tab.moreNavigationController.viewControllers firstObject];
if ([vc.view isKindOfClass:[UITableView class]]) {
[(UITableView *)vc.view setSeparatorStyle:UITableViewCellSeparatorStyleNone];
}