0
我在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
,分段控制仍然存在,所以最近推視圖的標題將與分段控制重疊。
如何使分段控制被壓入堆棧與以往有何看法?
正是我所需要的。 :) –