B68FloatingLabelTextField icon indicating copy to clipboard operation
B68FloatingLabelTextField copied to clipboard

floating labels shown on textfields with no text

Open ssavic opened this issue 9 years ago • 1 comments

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

ssavic avatar Oct 01 '15 19:10 ssavic

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) } }

misuqian avatar Dec 23 '15 11:12 misuqian