CosmicMind / Material

A UI/UX framework for creating beautiful applications.
http://cosmicmind.com
MIT License
11.98k stars 1.26k forks source link

RTL UITextField #1166

Closed pedroOliveiraptc closed 6 years ago

pedroOliveiraptc commented 6 years ago

Hey guys congrats for the work. i am facing a problem since ios12 and the new version that you guys release, my textfield in rtl break alignments as you can see above,

captura de ecra 2018-10-02 as 13 11 03 captura de ecra 2018-10-02 as 13 11 10 captura de ecra 2018-10-02 as 13 11 17 captura de ecra 2018-10-02 as 13 11 24

Do you already face this issue ? On iOS 11 and old version of the framework I don't have problems. Thanks.

daniel-jonathan commented 6 years ago

Hey @pedroOliveiraptc, Thank you. Can you try the development branch, and let us know if the issue persists. If so, please send a reproducible issue so we can investigate it. Thank you!

pedroOliveiraptc commented 6 years ago

@danieldahan thanks I will try.

pedroOliveiraptc commented 6 years ago

Hey @pedroOliveiraptc, Thank you. Can you try the development branch, and let us know if the issue persists. If so, please send a reproducible issue so we can investigate it. Thank you!

Hello the placeholder its ok, but the input text and the component line it self are not aligned.

captura de ecra 2018-10-03 as 08 57 55
OrkhanAlikhanov commented 6 years ago

@pedroOliveiraptc Can you share the code for us to achieve the same result on our computer?

pedroOliveiraptc commented 6 years ago

@pedroOliveiraptc Can you share the code for us to achieve the same result on our computer?

i will create a sample app to share. thanks.

daniel-jonathan commented 6 years ago

@pedroOliveiraptc Are you still facing this issue? If so, please reopen this and submit a sample app. Thank you!

pedroOliveiraptc commented 6 years ago

Hello sorry for the delay, the link for sample project

https://drive.google.com/file/d/1gl4BQvgH2QvU5FrU0FM3ViHDwUVVr_7U/view

OrkhanAlikhanov commented 6 years ago

Thank you we'll look into soon.

OrkhanAlikhanov commented 6 years ago

@pedroOliveiraptc You have following line:

UIView.appearance().semanticContentAttribute = .forceRightToLeft

It makes some changes internal to UITextField: image From: #WWDC15 App Frameworks

We give padding as much as the height of the textField if leftView has non-nil value. Since leftView is swapped with rightView internally when you have .forceRightToLeft, accessing leftView returns non-nil value (value of rightView) therefore we add padding. You workaround this by setting rightView to nil:

let textField = TextField()
textField.rightView = nil // so that when it gets swapped with leftView, leftView still stays nil

Actually we don' support RTL yet, so we don't test our framework against such cases.

btw, you can use development branch, it has cool updates such as Theming (#1115) and Dialog (#1173) :)

daniel-jonathan commented 6 years ago

@OrkhanAlikhanov I created an issue for us to support RTL. https://github.com/CosmicMind/Material/issues/1179, let's follow that issue for the RTL feature.