Iphone 如何自定义我的Tabbar控制器图标(背景图像)?

Iphone 如何自定义我的Tabbar控制器图标(背景图像)?,iphone,ios,ipad,Iphone,Ios,Ipad,我有一个iphone应用程序,我想在其中显示我自己的图像作为选项卡图标。但现在只有默认的灰色。我需要将其更改为“我自己的图像”。我浏览了很多链接,但似乎没有什么是非常清楚的。有人知道如何实现这一点吗?请从下载源代码并根据您的要求更改图像。请从下载源代码并根据您的要求更改图像。您可以在tabBarItem上设置图像,如下所示:- tabBarController = [[UITabBarController alloc] init]; tabBarController.delegate = sel


我有一个iphone应用程序,我想在其中显示我自己的图像作为选项卡图标。但现在只有默认的灰色。我需要将其更改为“我自己的图像”。我浏览了很多链接,但似乎没有什么是非常清楚的。有人知道如何实现这一点吗?

请从下载源代码并根据您的要求更改图像。

请从下载源代码并根据您的要求更改图像。

您可以在tabBarItem上设置图像,如下所示:-

tabBarController = [[UITabBarController alloc] init];
tabBarController.delegate = self;
ViewController *viewObject= [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController *navView = [[UINavigationController alloc] initWithRootViewController: viewObject];
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Tutorial" image:[UIImage imageNamed:@"kb-emoji-U+E031.png"] tag:1];
navView.tabBarItem = tabBarItem;
tabBarController.viewControllers = [NSArray arrayWithObjects:navView,nil];
self.window.rootViewController = tabBarController;

另请参见此链接-

您可以在tabBarItem上设置图像,如下所示:-

tabBarController = [[UITabBarController alloc] init];
tabBarController.delegate = self;
ViewController *viewObject= [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
UINavigationController *navView = [[UINavigationController alloc] initWithRootViewController: viewObject];
UITabBarItem *tabBarItem = [[UITabBarItem alloc] initWithTitle:@"Tutorial" image:[UIImage imageNamed:@"kb-emoji-U+E031.png"] tag:1];
navView.tabBarItem = tabBarItem;
tabBarController.viewControllers = [NSArray arrayWithObjects:navView,nil];
self.window.rootViewController = tabBarController;

另请参见此链接-

@TheSaad编辑了我的问题,请参见?您是在谈论这个objMoreTabController.tabBarItem.image=[UIImage ImageName:@“moreTabImage”];一点也不。我想在选项卡中显示我自己的图像,而不是默认的图像。我们可以使用UItabbarcontroler吗?你的意思是你想更改选项卡的整体外观吗?我显然想在选项卡中显示这些图像,而不是与默认图像颜色相同的图像。选中后,我需要更改图标的图像。这就是all@TheSaad编辑我的问题请看一下?你是在说这个objMoreTabController.tabBarItem.image=[UIImage ImageName:@“moreTabImage”];一点也不。我想在选项卡中显示我自己的图像,而不是默认的图像。我们可以使用UItabbarcontroler吗?你的意思是你想更改选项卡的整体外观吗?我显然想在选项卡中显示这些图像,而不是与默认图像颜色相同的图像。选中后,我需要更改图标的图像。这就是我想要的用我的UItabbarcontroller实现?我想用我的UItabbarcontroller实现?