更改 UIPickerView 行高
我正在为我正在参加的课程编写一个程序,该程序的一部分需要一个包含图像的 UIPickerView
。我已启动并运行选择器,但选择器中的行高度仍然太小,导致图像 (100x100) 重叠。我正在寻找一种更改 UIPickerView
的方法,以便图像适合一行而不重叠。谢谢
I'm working on a program for a class I'm taking and part of the program requires a UIPickerView
with images in it. I have the picker up and running, but the height of the rows in the picker are still too small, causing the images (100x100) to overlap. I'm looking for a way to change the UIPickerView
so that the images will fit in one row, without overlapping. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 UIPickerView,您有一个指向 UIPickerViewDelegate 协议。您可以实现一个方法,
pickerView:rowHeightForComponent:
。In the documentation for the UIPickerView, you have a link to the UIPickerViewDelegate protocol. There is a method that you can implement,
pickerView:rowHeightForComponent:
.使用此方法,提供默认值作为委托方法。
objective-C
在 Swift 中:
了解更多信息,请访问:现实世界的实现
use this method,provide default as a delegete method.
objective-C
In Swift:
for more visit : real world implementation