自定义 UIPickerView - 增加不滚动显示的项目数量

发布于 2024-12-21 09:24:50 字数 60 浏览 3 评论 0原文

选择器通常会显示 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

葮薆情 2024-12-28 09:24:50

有点儿。 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 the UIPickerView using the -pickerView:rowHeightForComponent: delegate method. If you return a small enough number, you could fit about 200 items in a UIPickerView all at once. They'd all be a single point tall, but you get the idea...

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文