1

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 1

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.