在我的导航栏中,我有一个leftbarbuttonitem和一个rightbarbuttonitem。在进行设备定位时,这些按钮项目会在标题视图中显示几秒钟,然后返回到结束位置。这种重新定位的任何解决方案。 提前致谢。
UIBarButtonItem *btLeftItem = [[UIBarButtonItem alloc] initWithCustomView:segNav];
[segNav release];
UIBarButtonItem *btRightItem = [[UIBarButtonItem alloc] initWithCustomView:segRight];
[segRight release];
//segNav and segRight are UISegmentedControl objects
navItem = [[UINavigationItem alloc] init];
[navItem setRightBarButtonItem:btRightItem]; //set left button for navigation item
[navItem setLeftBarButtonItem:btLeftItem]; //set right button for navigation item
[navItem setTitleView:titleLab]; //set navigation item title view