首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >UIPickerView不能在actionSheet中滚动

UIPickerView不能在actionSheet中滚动
EN

Stack Overflow用户
提问于 2011-05-23 21:59:02
回答 1查看 1.1K关注 0票数 0

我已经在UIActionSheet中添加了一个UIPickerView。一切正常,但是我的选择器不能滚动来选择值。有什么建议吗?

代码语言:javascript
复制
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];

致以最好的问候,多林

EN

回答 1

Stack Overflow用户

发布于 2011-05-24 02:23:58

您要实现的另一种解决方案是设置文本字段的inputViewinputAccessoryView。设置这些将取代标准键盘,并引入自定义视图。这包括选取器视图。我碰巧在这里用这个question写了一个简短的例子。看一下,看看是否有帮助。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/6098220

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档