Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/35.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/5.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 如何在导航控制器中添加选项卡项?_Iphone - Fatal编程技术网

Iphone 如何在导航控制器中添加选项卡项?

Iphone 如何在导航控制器中添加选项卡项?,iphone,Iphone,我正在开发基于导航的应用程序……首先,当我按下“警报”按钮时……它会显示标签、按钮、图像和选项卡栏下的项目……我们如何添加选项卡栏项目?最多用途的方法是添加透明的UIView,然后向其中添加任何内容: UIView *buttonsHandlerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)]; buttonsHandlerView.backgroundColor = [UIColor clearColor]; UIB

我正在开发基于导航的应用程序……首先,当我按下“警报”按钮时……它会显示标签、按钮、图像和选项卡栏下的项目……我们如何添加选项卡栏项目?

最多用途的方法是添加透明的UIView,然后向其中添加任何内容:

UIView *buttonsHandlerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 50)];
buttonsHandlerView.backgroundColor = [UIColor clearColor];
UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithCustomView:buttonsHandlerView];
[self.navigationItem setRightBarButtonItem:backButtonItem animated:YES];
[backButtonItem release];

//[buttonsHandlerView addSubview:__anything__];

[buttonsHandlerView release];
或者使用title/type初始化UIBarButtonim并将其用作按钮