Open rami965 opened 3 years ago
I have same issue, did you find a solution for this ?
sam here
I'm trying to think of a solution, but until I find a solution, you can handle that in your BaseTextField
by doing something like this:
func updateTextAligment() {
if(isRightToLeft) {
self.textAlignment = .left
} else {
self.textAlignment = .right
}
}
@Abedalkareem This is my solution if it helps:
I added an extension for NSTextAlignment
import LanguageManager_iOS
extension NSTextAlignment {
static var defaultAlignment: NSTextAlignment {
return LanguageManager.shared.currentLanguage == .ar ? .right : .left
}
}
Usage
myTextField.textAlignment = .defaultAlignment
@rami965 why everyone thinks that Arabic is the single language with RTL?
Here is a screenshot for the representing the issue:
What I tried:
Note that I'm using a navigation controller and the rtl is working fine except for text fields.