Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/43.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone 在UITabBarController中向我自己的类施放一个UITabBar_Iphone_Ios_Uitabbarcontroller_Subclass_Uitabbar - Fatal编程技术网

Iphone 在UITabBarController中向我自己的类施放一个UITabBar

Iphone 在UITabBarController中向我自己的类施放一个UITabBar,iphone,ios,uitabbarcontroller,subclass,uitabbar,Iphone,Ios,Uitabbarcontroller,Subclass,Uitabbar,我正在使用UITabBarController,我想将tabBar属性强制转换/更改为我自己的tabBar子类。我可以在Interface Builder中这样做,只需选择TabBar并将类更改为我自己的,这很好。但是对于这个实现,我没有使用Interface Builder 那么,既然我是以编程方式构建Tabbar控制器,我该如何做同样的事情呢?subtabar:UItabbar subclass then declare in viewcontroller also (import t

我正在使用UITabBarController,我想将tabBar属性强制转换/更改为我自己的tabBar子类。我可以在Interface Builder中这样做,只需选择TabBar并将类更改为我自己的,这很好。但是对于这个实现,我没有使用Interface Builder

那么,既然我是以编程方式构建Tabbar控制器,我该如何做同样的事情呢?

subtabar:UItabbar

subclass then  

declare in viewcontroller also (import them to .h)

subtabbar *subtab;

retain and synthesize it

in viewdidload

self.tabBarController=[[UITabBarController alloc]init];

self.subtab=[[UITabBar alloc]init];

self.tabBarController.tabBar=(UITabBar*)self.subtab;