What I want to achieve is picker with 3 components simultaneously scrolling, so what I am doing is using 1 component and spacing out the text. I can gather the width of the text using UIFont sizewithFont Method.So what I need to calculate is amount of emptyspaces b/w 1-2 and 2-3 Components to add.
1 Answer
Use viewForRow instead of titleForRow and return a view with 3 labels laid out as needed. No need to deal with adding spaces. Just setup constraints for the labels within the view.
Much easier than calculating text sizes and trying to pad the text with spaces, none of which will come out perfectly.
1 Comment
Sumit Oberoi
Thanks I tried with that, using stack view inside of custom view but It was behaving somewhat weirdly, it was returning only one row/instance of the view