自定义 UIPickerView
各位开发人员大家好,我正在尝试添加一个 UIPickerView,它看起来像 Oanda 的货币转换工具中显示的那样,因为我认为它很好而且很整洁。请参考下图。
我已经阅读了一些教程/示例,包括 Apple 的 UICatalog,但它似乎没有向我们展示如何:
- 减少显示的行数(Oanda 仅显示 3 行)
- 更改边框颜色(Oanda 显示黑色,我已经看到开发人员使用 UIImage 覆盖 UIPickerView 的边缘)
- 更改突出显示的行覆盖颜色(Oanda 为浅绿色)
- 更改选择器的大小
希望对示例代码有任何帮助。
Hello fellow developers, I am trying to include a UIPickerView that looks like the one shown within Oanda's Currency Coverter, because I think it's nice and neat. Please refer to image below.
I have read a few tutorials/samples including Apple's UICatalog but it doesn't seem to show us how to:
- reduce the number of rows displayed (Oanda showing 3 rows only)
- change the border colour (Oanda showing a black, and I have seen developers using an UIImage to cover up the edges of UIPickerView)
- change the highlighted row overlay colour (Oanda has light green)
- change the size of the picker
Would appreciate any help with sample code.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里有一些关于调整 UIPickerView 大小的讨论,iOS 3 和4.
There is some discussion on the resizing of UIPickerView here, some approaches changed between iOS 3 and 4.