如何以编程方式在iOS中添加UITabBarItem的标识符类型? [英] How to programmatically add UITabBarItem's Identifier type in iOS?

查看:94
本文介绍了如何以编程方式在iOS中添加UITabBarItem的标识符类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在iOS中以编程方式添加UITabBarItem。

I want to add UITabBarItem in programmatically in iOS.

在界面生成器中,我们可以轻松选择标识符搜索,收藏夹,最近选项卡等。

In interface Builder,we can easily choose with Identifier for Search,Favourites,Recent Tabs,etc..

我想知道如何以编程方式添加这些标识符类型?

I would like to know how can i add these Identifier type in programatically?

推荐答案

您将其添加为UIViewController的属性?
你创建一个 UITabBarItem

You add it as a UIViewController's property? You create a UITabBarItem

UITabBarItem * localTabBarItem = [[UITabBarItem alloc ]
initWithTitle:@日期图片:clockIcon标签:0];

然后设置UIViewController的属性

And then set UIViewController's property

[viewController setTabBarItem:localTabBarItem];

这是一大包TabBar图像 http://www.axialis.com/objects/ip_icon_09.shtml

Here is a huge pack of TabBar images http://www.axialis.com/objects/ip_icon_09.shtml

这篇关于如何以编程方式在iOS中添加UITabBarItem的标识符类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆