0

我在详细视图的导航栏右侧创建了一个向上/向下箭头分段控制按钮。如何使用这些向上/向下箭头来更改视图?

4

1 回答 1

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
    } 
}
于 2010-05-16T00:30:12.993 回答