我正在尝试制作一个包含三列的扑克选择器视图。在每一列中,我都有标准的卡片列表,每张卡片代表一行。如果我在最左列选择“红心王牌”,那么下一列将是标准列表,不包括“红心王牌”。如果我在第二列中选择“梅花 3”,则第三栏将包含标准列表,不包括“红心王牌”和“梅花 3”
有人可以告诉我该怎么做吗?
我当前的代码仅适用于一列,所有三列代表一列,因此不方便发布。
我正在使用NSArray
默认列表,并且还使用UIActionSheet
.
self.myPickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 43 , 320, 480)];
self.myPickerView.delegate = self;
self.myPickerView.dataSource = self;
[self.myPickerView setShowsSelectionIndicator:YES];
// Create done button in UIPickerView
self.myPickerViewToolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, 320, 56)];
// self.myPickerViewToolBar.barStyle = UIBarStyleBlackOpaque;
[self.myPickerViewToolBar sizeToFit];
NSMutableArray *barItems = [[NSMutableArray alloc] init];
UIBarButtonItem *flexSpace = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[barItems addObject:flexSpace];
UIBarButtonItem *doneBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(pickerDoneClicked)];
[barItems addObject:doneBtn];
[self.myPickerViewToolBar setItems:barItems animated:YES];
self.sheet = [[UIActionSheet alloc] initWithTitle:nil
delegate:self
cancelButtonTitle:@"Done"
destructiveButtonTitle:nil
otherButtonTitles:nil];
}