Is there a way to prevent the setting of tab items?

I built a panel with more than 5 tabs, and the rest was automatically added to the "More" view. This is normal, but at the same time, the user can "Change" the settings of the application tabs.

I do not want the user to be able to do this. Is there a way to prevent this from happening to the user?

+5
source share
2 answers

Take a look at the UITabBarController documentation . Search "customizableViewControllers"

customizableViewControllers

Manage a subset of dispatchers using this tab bar controller, which can be customized.

@property (, ) NSArray * customizableViewControllers

, . "" , . Edit, . . , - .

viewControllers ( setViewControllers: : ) . , .

, nil:


- (void)applicationDidFinishLaunching:(UIApplication *)application
{
tabBarController.customizableViewControllers=nil;
}

,
VFN

+2
// 'Move view' customization
// MORE tab bar items 'More view'
- (void)applicationDidFinishLaunching:(UIApplication *)application {
  self.tabBarController.customizableViewControllers=nil;

  UIViewController  * moreController =
  [[self.tabBarController.moreNavigationController viewControllers] objectAtIndex:0] ;
  UITableView * moreTableView = ( UITableView *)  [moreController view];
  [moreTableView setSeparatorColor:[UIColor redColor]];
  [moreTableView setBackgroundColor:[UIColor yellowColor]];
}
+1

All Articles