Open fadiBlessedTree opened 5 years ago
I found the problem
you have to remove
rect.origin.x -= CGFloat(iconWidth + iconMarginLeft)
from textRect too like editingRect
override open func textRect(forBounds bounds: CGRect) -> CGRect {
var rect = super.textRect(forBounds: bounds)
if isLTRLanguage {
rect.origin.x += CGFloat(iconWidth + iconMarginLeft)
} else {
// don't change the text field X position for RTL languages
}
rect.size.width -= CGFloat(iconWidth + iconMarginLeft)
return rect
}
hope we get this fix in next release. Thanks 😊
Hey @fadiBlessedTree any chance you can send a PR for this? Thanks a bunch
I found the problem you have to remove rect.origin.x -= CGFloat(iconWidth + iconMarginLeft) from textRect too like editingRect
Class : (SkyFloatingLabelTextFieldWithIcon)
Function : (textRect(forBounds bounds: CGRect) -> CGRect)
Full function after fix the problem :
override open func textRect(forBounds bounds: CGRect) -> CGRect { var rect = super.textRect(forBounds: bounds) if isLTRLanguage { rect.origin.x += CGFloat(iconWidth + iconMarginLeft) } else { // don't change the text field X position for RTL languages } rect.size.width -= CGFloat(iconWidth + iconMarginLeft) return rect }
hope we get this fix in next release. Thanks 😊
i try that but still have same issue
same issue
Report
What did you do?
Add RTL Localization to my app "Arabic"
What did you expect to happen?
Work fine without see more spaces before text
What happened instead?
There is extra space before text when I use "SkyFloatingLabelTextFieldWithIcon" with icon
Icon type value = 1
Environment
Xcode Version: 10.1 (10B61) SkyFloatingLabelTextField Version: 3.6.0 Deployment Target: 9.4 Base SDK: 11.4 Method of Integration: CocoaPods
Project that demonstrates the issue