Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找一种为 UIPickerView 的每一列(组件)添加标题的方法。在我看到的所有示例中,没有标题,因为通常可以根据其顺序、内容和上下文来确定列的含义……但是在我的应用程序中,混淆列是很危险的,所以我需要给出他们的头衔。
问候, 克雷格
我这样做的方法是创建一个父 UIView 来保存您的 UIPickerView 并为列标题添加一系列 UILabel。所以你不会对 UIPickerView 做任何神奇的事情,你只是在它上面显示一些标签,看起来它们是同一个小部件的一部分。