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.
我在 xcode7.3.1 中使用 swift。我想为 UIPickerView 中的每一行添加分隔线。我想将 UIPickerview 实现为以下屏幕截图
如何解决这个问题。请帮助我
使用-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view方法,而不是使用titleForRow ..方法
-(UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
titleForRow ..
在这里创建您的自定义视图,带有标签和底线(UIView- as line)并返回该视图。
您将通过此步骤获得所需的效果。