这是我的实现,我基本上是在动态创建动作表和选择器视图。问题是显示您选择的项目未显示的指示符。
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:title delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:nil];
actionSheet.actionSheetStyle = UIActionSheetStyleDefault;
UIPickerView* picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0,100, 320, 216)];
picker.dataSource = self;
picker.delegate = self;
[actionSheet addSubview:picker];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0,0, 320, 411)];
答案 0 :(得分:10)
看起来你错过了这一行:
[picker setShowsSelectionIndicator:YES];