我正在开发基于导航的应用程序...首先,当我按下提醒按钮时......显示标签,按钮,图像和下方的标签栏项目...我们如何添加标签栏项目?
答案 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并将其用作按钮