选择指示器未显示在操作表内的选取器视图中

时间:2012-03-21 16:31:26

标签: ios ios5 uipickerview uiactionsheet

这是我的实现,我基本上是在动态创建动作表和选择器视图。问题是显示您选择的项目未显示的指示符。

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)]; 

1 个答案:

答案 0 :(得分:10)

看起来你错过了这一行:

[picker setShowsSelectionIndicator:YES];