Reducing the space between UIPickerView components

I want to reduce the space between the various components in a UIPickerView. In fact, I want to build a selection view similar to the Timer app in Watch on iPhone.

I believe that there are 4 components. First, the hours component (0,1,2....23) , the second is the hour component, the third is minutes (0,1,2....59) , and the fourth is the min component. How can I increase the comparative space between hour and Minute Components. I do not want to use the hour and minute words with each hour value and each min value.

+6
source share
1 answer

you will need to use the delegate method widthForComponent. below is an example for Swift. just find the equivalent of objective-c.

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

Source: https://habr.com/ru/post/981750/


All Articles