UITabBarController 里面有个属性:selectedIndex
@property(nonatomic) NSUInteger selectedIndex;
UITabBarController *VC = [[UITabBarController alloc]init];
VC.selectedIndex = n-1;
[self.navigationController pushViewController:VC animated:YES];
时间: 2024-10-16 14:28:00