我已经在UIActionSheet中添加了一个UIPickerView。一切正常,但是我的选择器不能滚动来选择值。有什么建议吗?
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:nil cancelButtonTitle:nil destructiveButtonTitle:nil otherButtonTitles:nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackTranslucent;
UIPickerView * picker = [[UIPickerView alloc] initWithFrame:CGRectMake(0, 50, 320, 270)];
picker.showsSelectionIndicator = YES;
picker.dataSource = self;
picker.delegate = self;
[actionSheet addSubview:picker];
[picker release];
[actionSheet showInView:self.view];
[actionSheet setBounds:CGRectMake(0, 0, 320, 500)];
[actionSheet release];致以最好的问候,多林
发布于 2011-05-24 02:23:58
您要实现的另一种解决方案是设置文本字段的inputView和inputAccessoryView。设置这些将取代标准键盘,并引入自定义视图。这包括选取器视图。我碰巧在这里用这个question写了一个简短的例子。看一下,看看是否有帮助。
https://stackoverflow.com/questions/6098220
复制相似问题