このアプリケーションは問題があります。UITabBarItems in UITabBarは、アプリケーションが起動したときにアイテムをクリックしないと表示されます。
私はアプリケーションウィンドウにUITabBar
を設定し、アイコンをビューファイルに設定しています。 しかし、私はアプリを実行すると、最初のアイコンが表示されます(私は推測するので、ビューがロードされているので)、他のアイコンはクリックするまで表示されません。
self.tabBarItem
を別の方法で実装する必要がありますか?viewDidLoad
?
おかげさまで皆様に感謝します!
- (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];
}
どうもありがとう! :)それは完璧に働いた:) – Olsi
私は迅速な2でこれを行うには? – deepakssn
これはまだ7年後のSwiftの問題を解決します。 – SQLiteNoob