10

I want to reduce the space between the different components in a UIPickerView. Actually i want to build a picker view similar to the Timer in Watch app in iPhone.

i believe there are 4 components. First the hours component (0,1,2....23), the second one was hour component, third one was minutes (0,1,2....59) and fourth is min component. How i can increase the comparative space between Hour and Minute Components. I don't want to use hour and min word with every hour value and every min value.

2
  • pickerView:widthForComponent: from UIPickerViewDelegate?
    – Larme
    Jan 30, 2015 at 9:57
  • i want to set the space between the different components not the width of an individual component. This method sets the width of individual component in the picker view. Jan 30, 2015 at 10:00

1 Answer 1

24

you would have to use the widthForComponent delegate method. the following is an example for Swift. just find the objective-c equivalent.

func pickerView(pickerView: UIPickerView, widthForComponent component: Int) -> CGFloat {
    return 30.0
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.