在 iPhone 中自定义选择器视图
如何在 iPhone 中创建自定义 UIPicker 视图。我想自定义背景颜色、滚轮样式。我还想自定义不同行的选择。如何完成。 谁能帮助我 提前致谢。
How to create Customized UIPicker View in iphone.I want to customize the background Color,Style of wheel.I also want to customize the different row's selection.How it will be done.
Can Anyone help me
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以按照 Gypsa 的说明更改行的视图。
然而,如果你想改变 UIPickerView 的外观,在它上面放置一个透明的 png 是你最好的选择。只需确保禁用 png 上的用户交互,以便您可以与滚轮交互。
下面的屏幕截图来自我最新的应用程序。
祝你好运。
无皮肤的笔尖:
有皮肤的笔尖:
最终应用程序:
You change change the view of the rows as Gypsa stated.
However if you want to change the appearance of the UIPickerView, laying out a transparent png on top of it is your best bet. Just make sure you disable user interactions on the png, so that you can interact with the wheel.
Below screenshots are from my latest app.
Good luck.
Nib without the skin:
Nib with the skin:
Final app:
你好
使用此方法自定义您的选择器视图:-
这是加载或重新加载选择器视图时调用的委托方法
Hi
Use this method to customize your pickerview:-
This is the delegate method which is called when picker view loaded or reloads