【发布时间】:2016-11-11 12:40:50
【问题描述】:
我的navigationBar 上有一个UISegmentedController。分段控件是使用以下代码添加的:
@property (nonatomic) UISegmentedControl *segView;
...
- (void)viewDidLoad {
[super viewDidLoad];
_segView = [[UISegmentedControl alloc] initWithItems:@[@"Seg1", @"Seg2"]];
[_segView setSelectedSegmentIndex:0];
[_segView addTarget:self action:@selector(segmentAction:) forControlEvents:UIControlEventValueChanged];
[self.navigationController.navigationBar addSubview:_segView];
}
当我将视图推送到navigationController 时,分段控件还在,所以最近推送的视图的标题会与分段控件重叠。
如何使分段控件与前一个视图一起被压入堆栈?
【问题讨论】:
标签: ios objective-c uinavigationcontroller uinavigationitem