SkyFloatingLabelTextField icon indicating copy to clipboard operation
SkyFloatingLabelTextField copied to clipboard

how to align the text to keep it in the middle

Open abhijitpp opened this issue 7 years ago • 5 comments

Report

What did you do?

ℹ I am trying to make an OTP Screen page in iOS i have achieved all the functionality just i got one issue that i want it keep the text in the middle of the textfield

What happened instead?

ℹ it starts from the exact corner of the text field

Xcode Version: 9.2 SkyFloatingLabelTextField Version: updated version Method of Integration: CocoaPods | Carthage | Manual : CocoaPods

abhijitpp avatar Jun 28 '18 12:06 abhijitpp

Hey @abhijitpp can you give some more details on this? The component is an extesions of UITextField so any method that works for centering text in a UITextField should be applicable

k0nserv avatar Jul 12 '18 10:07 k0nserv

sky ignores the alignment property of the base textfield.

vindicatesociety avatar Aug 21 '18 19:08 vindicatesociety

It should appear like this

(Watch vertical centering)

Thank you!

m3rLin0WoRK avatar Sep 20 '18 12:09 m3rLin0WoRK

@abhijitpp , Update the function as below in SkyFloatingLabelTextField class -

fileprivate func updateTextAligment() { if isLTRLanguage { textAlignment = .center titleLabel.textAlignment = .center } else { textAlignment = .right titleLabel.textAlignment = .right } }

hiteshimpinge avatar Apr 05 '19 08:04 hiteshimpinge

Same issue here. Can't align the text to right of text field. Can anyone help?

suhailshaikh001 avatar Feb 27 '20 06:02 suhailshaikh001