iOS開発を始めたばかりで、atmの周りで遊んでいます。iOSカスタムタブバー
私は、デフォルトのタブバーボタンをさらにカスタムに変換しようとしています。後
私はあなたがすべてのボタンにカスタム状態を作成することができたので、私がやったの周り探していくつか:
UIImage *selectedImage0 = [UIImage imageNamed:@"first.png"];
UIImage *unselectedImage0 = [UIImage imageNamed:@"second.png"];
UITabBar *tabBar = self.tabBarController.tabBar;
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
[item0 setFinishedSelectedImage:selectedImage0 withFinishedUnselectedImage:unselectedImage0];
しかし、私はそれが画像を変更し、デフォルトボタンを取り除くことはできませんが、それボタン全体が変わらない
私は何か他に何かする必要がありますか?
UIViewController *viewController1 = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil];
UIViewController *viewController2 = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, nil];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
UIImage *selectedImage0 = [UIImage imageNamed:@"first.png"];
UIImage *unselectedImage0 = [UIImage imageNamed:@"second.png"];
UITabBar *tabBar = self.tabBarController.tabBar;
UITabBarItem *item0 = [tabBar.items objectAtIndex:0];
[item0 setFinishedSelectedImage:selectedImage0 withFinishedUnselectedImage:unselectedImage0];
http://stackoverflow.com/questions/4710298/how-can-i-create-custom-tab-bar-add-custom-images-in-tab-bar-without-xib-cha...Visitこのスタックポスト.. – Nit
このチュートリアルとカスタムタブバーのソースコードを参照してください。 [カスタムタブバー](http://cocoacontrols.com/search?utf8=%E2%9C%93&q=tabbar) –
[この回答](http://stackoverflow.com/questions/41139914/how-to-make- multiple-color-tab-bar-in-swift-3/41140329#41140329)が役に立ちます。 –