UIPickerView列标题 [英] UIPickerView column Titles

查看:49
本文介绍了UIPickerView列标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种向UIPickerView的每一列(组件)添加标题的方法.在我看到的所有示例中,都没有标题,因为通常可以根据列的顺序,内容和上下文来确定列的含义...但是,在我的应用程序中,混淆列会很危险,因此我需要给出他们的头衔.

I am looking for a way to add a title to each column (component) of the UIPickerView. In all the examples I've seen there are no titles because in general the columns meaning could be figured out based on its order, content and context... however in my application it would be dangerous to confuse the columns so I need to give them titles.

关于, 克雷格

推荐答案

我这样做的方法是创建一个父UIView来保存您的UIPickerView&为列标题添加一系列UILabel.因此,您无需对UIPickerView进行任何神奇的处理,只需在其上方显示一些标签即可,就像它们是同一小部件​​的一部分一样.

The way I'd do this would be to create a parent UIView that holds your UIPickerView & add a series of UILabels for column titles. So you don't do anything magical to the UIPickerView, you just display some labels above it in a way that looks like they're part of the same widget.

这篇关于UIPickerView列标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆