Changing UIPickerView row height

后端 未结 2 893
难免孤独
难免孤独 2020-12-15 08:31

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 h

2条回答
  •  天命终不由人
    2020-12-15 08:41

    use this method,provide default as a delegete method.

    objective-C

    - (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component
    {
        return 40;
    }
    

    In Swift:

    func pickerView(pickerView: UIPickerView, rowHeightForComponent component: Int) -> CGFloat 
    {   
        return 40
    }
    

    for more visit : real world implementation

提交回复
热议问题