自定义 UIPickerView - 增加不滚动显示的项目数量
选择器通常会显示 5 个项目,无需滚动。有没有办法增加选择器的大小以显示最多 8 个项目而不滚动。请帮忙。
Picker normally shows 5 items without scrolling. Is there a way to increase the size of the picker to show up to 8 items without scrolling. Please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有点儿。
UIPickerViews
只能是一定数量的点高(很容易找出这些点是您自己的),但是您可以调整UIPickerView
中项目的高度使用-pickerView:rowHeightForComponent:
委托方法。如果您返回的数量足够小,则可以一次在UIPickerView
中容纳大约 200 个项目。它们都是一个点高,但你明白了......Kind of.
UIPickerViews
can only be a certain number of points tall (easy enough to find out what those are yourself), but you can fiddle around with the height of the items in theUIPickerView
using the-pickerView:rowHeightForComponent:
delegate method. If you return a small enough number, you could fit about 200 items in aUIPickerView
all at once. They'd all be a single point tall, but you get the idea...