Navigation with UISegmentcontrol iphone
I have created an up/down arrow segmented control button on the right side of the navigation bar in my detail view. How can I use these up/down arrows to 开发者_StackOverflowchange views?
[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
}
}
精彩评论