B68FloatingLabelTextField
B68FloatingLabelTextField copied to clipboard
floating labels shown on textfields with no text
If you add a floating label text field to a tableview cell and add about 20 or so of them, so that they are off the screen. when tableview reuses cells, it still shows floating label even for the textfields that have no text.
I've fixed the issue, but i'm having issue make a pull request.
This is where the issue is:
override public func layoutSubviews() { super.layoutSubviews() if (isFirstResponder() && !hasText()) { hideFloatingLabel() } else if(hasText()) { showFloatingLabelWithAnimation(true) } }
just change it to:
override public func layoutSubviews() { super.layoutSubviews() if ((isFirstResponder() && !hasText()) || !hasText()) { hideFloatingLabel() } else if(hasText()) { showFloatingLabelWithAnimation(true) } }
Sasa
I change the code and have no effect. below is my changes and it work very well
override public func hasText() ->Bool { return self.text! != "" }
override public func layoutSubviews() { super.layoutSubviews() if (!isFirstResponder() && !hasText()) { hideFloatingLabel() } else { showFloatingLabelWithAnimation(true) } }