Commit cf2e3ca7 by Shoaib Ahmed

Resolves issue #456 (TextField misplaced placeholder (RTL))

parent c309b843
......@@ -477,6 +477,7 @@ public class TextField : UITextField {
preparePlaceholderLabel()
prepareDetailLabel()
prepareTargetHandlers()
prepareTextAlignment()
}
/// Ensures that the components are sized correctly.
......@@ -628,4 +629,14 @@ public class TextField : UITextField {
addTarget(self, action: #selector(handleEditingDidBegin), forControlEvents: .EditingDidBegin)
addTarget(self, action: #selector(handleEditingDidEnd), forControlEvents: .EditingDidEnd)
}
/// Prepares the target handlers.
private func prepareTextAlignment() {
if (UIApplication.sharedApplication().userInterfaceLayoutDirection == .RightToLeft) {
self.textAlignment = .Right
}
else {
self.textAlignment = .Left
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment