0
我从模板中选择了基于标签栏的应用程序。在我需要设置的自定义图像我试图像下面需要在iphone中设置tabbar图片?
UIViewController *viewController1 = [[[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:nil] autorelease];
UINavigationController *view1=[[UINavigationController alloc]initWithRootViewController:viewController1];
UIViewController *viewController2 = [[[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:nil] autorelease];
UINavigationController *view2=[[UINavigationController alloc]initWithRootViewController:viewController2];
UIViewController *viewController3 = [[[SecondViewController alloc] initWithNibName:@"ThirdViewController" bundle:nil] autorelease];
UINavigationController *view3=[[UINavigationController alloc]initWithRootViewController:viewController3];
UIViewController *viewController4 = [[[SecondViewController alloc] initWithNibName:@"MainViewController" bundle:nil] autorelease];
UINavigationController *view4=[[UINavigationController alloc]initWithRootViewController:viewController4];
self.tabBarController = [[[UITabBarController alloc] init] autorelease];
self.tabBarController.delegate=self;
self.tabBarController.viewControllers = [NSArray arrayWithObjects:view1,view2,view3,view4, nil];
[self.tabBarController.tabBarItem setImage:[UIImage imageNamed:@"h.png"]];
另一种方式给我试图
[[_tabBarController tabBar] setBackgroundImage:[UIImage imageNamed:@"h.png"]];
在第二种方式有图像应用,但是它是一个背景。
所以我个人需要一个像家按钮类似的东西....
如何设置这个... 感谢....
是你的问题解决了吗? – Rajneesh071