如何在导航控制器中添加tabbar项?

时间:2010-09-21 06:06:48

标签: iphone

我正在开发基于导航的应用程序...首先,当我按下提醒按钮时......显示标签,按钮,图像和下方的标签栏项目...我们如何添加标签栏项目?

1 个答案:

答案 0 :(得分:1)

最通用的方法是添加透明的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];

或者使用标题/类型初始化UIBarButtonItem并将其用作按钮