我在详细视图中的导航栏右侧创建了一个向上/向下箭头分段控制按钮。如何使用这些向上/向下箭头更改视图?
答案 0 :(得分:1)
[mySegmentedControl addTarget:self action:@selector(mySegmentedControlTapped:) forControlEvents:UIControlEventValueChanged];
...
- (void) mySegmentedControlTapped:(id)sender {
NSUInteger selectedOption = mySegmentedControl.selectedSegmentIndex;
if (selectedOption == upArrowIndex) {
// swap in "up"-ward view controller
}
else if (selectedOption == downArrayIndex) {
// swap in "down"-ward view controller
}
}