1

I've implemented a time picker (hours and minutes) using UIPickerView in my app and it suppose to support RTL languages as well. Under its constraints I've changed the leading constraint to not respect language direction, so that leading constraint is now left constraint (I have no use on trailing constraint here).

The problem - running the app in RTL language still effects my picker and it shows the minutes on the left and hours on the right (still affected).

Any help is appriciated, thanks.

Paebbels
  • 15,573
  • 13
  • 70
  • 139
Max
  • 799
  • 1
  • 5
  • 17

2 Answers2

1

So i've kept going through the net but couldn't find a solution so i started digging xcode.

for those of you who might encounter this issue i solved it by:

  1. going into attributes inspector in the storyboard
  2. under 'view' there is a 'semantic' drop down
  3. choose 'force left to right'
Max
  • 799
  • 1
  • 5
  • 17
  • 1
    What if you have created it programmatically? Setting force left to right doesn't work for me. – Hemang Apr 27 '18 at 10:38
0

If you created the uipickerview programmatically, add the below code to APPDelegate.swift: (Based on this answer)

UIPickerView.appearance().semanticContentAttribute = .forceLeftToRight
Sam
  • 446
  • 7
  • 17