本文介绍了如何自定义tabbarcontroller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将图像添加到tabbarcontroller。我将navigationcontroller作为tabbarcontroller中的tabbar项包含在内。那么如何将图像添加到tabbarcontroller。
I need to add image to the tabbarcontroller. I included navigationcontroller as a tabbar item in tabbarcontroller. So how can i add image to the tabbarcontroller.
tabBarController = [[UITabBarController alloc] init];
tabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;
tabBarController.moreNavigationController.topViewController.view.backgroundColor=[UIColor clearColor];
tabBarController.delegate=self;
Dashboard_iPhone *dash = [[Dashboard_iPhone alloc] init];
UINavigationController *tabItem0 = [[[UINavigationController alloc] initWithRootViewController:dash] autorelease];
tabItem0.view.backgroundColor=[UIColor clearColor];
TrackProgram_iPhone *rep = [[TrackProgram_iPhone alloc] init];
UINavigationController *tabItem1 = [[[UINavigationController alloc] initWithRootViewController:rep] autorelease];
tabBarController.tabBarItem.title=@"TrackProgram";
tabItem1.view.backgroundColor=[UIColor clearColor];
TrackClinic_iPhone *loc = [[TrackClinic_iPhone alloc] init];
UINavigationController *tabItem2 = [[[UINavigationController alloc] initWithRootViewController:loc] autorelease];
tabBarController.tabBarItem.title=@"TrackClinic ";
tabItem2.view.backgroundColor=[UIColor clearColor];
tabBarController.viewControllers=[NSArray arrayWithObjects:tabItem0,tabItem1,tabItem2,nil];
[self.view insertSubview:tabBarController.view belowSubview:dash.view ];
[self presentModalViewController:tabBarController animated:NO];
请帮我添加图片到tabbarcontroller。
please help me to add image to tabbarcontroller.
推荐答案
自定义TabBarController。各种许可证。
Custom TabBarController. various licenses.
这篇关于如何自定义tabbarcontroller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!