Diese Anwendung, die ich schreibe, hat ein Problem.UITabBarItems in UITabBar anzeigen, nachdem ich auf das Element nicht beim Start der Anwendung geklickt habe
Ich bin die UITabBar
in meinem Anwendungsfenster einrichten und legen Sie die Symbole in den Ansichtsdateien. Aber wenn ich die App starte, erscheinen die ersten Symbole (weil die Ansicht geladen ist, nehme ich an) und die anderen Symbole werden erst angezeigt, wenn ich auf sie klicke.
Muss ich self.tabBarItem
in einer anderen Methode implementieren, nicht viewDidLoad
?
Vielen Dank im Voraus an alle!
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
tabBar = [[UITabBarController alloc] init];
SubscriptionsController *subscriptionsController = [[SubscriptionsController alloc] init];
FavoritesController *favoritesController = [[FavoritesController alloc] init];
CategoriesController *categoriesController = [[CategoriesController alloc] init];
TagsController *tagsController = [[TagsController alloc] init];
HelpScreenController *helpScreenController = [[HelpScreenController alloc] init];
tabBar.viewControllers = [NSArray arrayWithObjects:
subscriptionsController,
favoritesController,
categoriesController,
tagsController,
helpScreenController,
nil
];
[window addSubview:tabBar.view];
// Override point for customization after application launch.
[window makeKeyAndVisible];
return YES;
}
//The View
- (void)viewDidLoad {
[super viewDidLoad];
tabIcon = [[UITabBarItem alloc] initWithTitle:@"Abonime" image:[UIImage imageNamed:@"subscr.png"] tag:0];
self.tabBarItem = tabIcon;
[tabIcon release];
}
Vielen Dank! :) es hat einwandfrei funktioniert :) – Olsi
Wie mache ich das in swift 2? – deepakssn
Dies löst noch Probleme in Swift - 7 Jahre später. – SQLiteNoob