fahimf / floatlabelfields Goto Github PK
View Code? Open in Web Editor NEWText entry controls which contain a built-in title/label so that you don't have to add a separate title for each field.
License: MIT License
Text entry controls which contain a built-in title/label so that you don't have to add a separate title for each field.
License: MIT License
please add support for carthage and cocoapods
Please add swift 2 support, possibly in a separate branch.
Isn't it possible to use a round border style with FloatLabelFields? That could be awesome
I'd like to change the placeholderTextColor
but it's a constant not an inspectable variable like titleTextColour
. This is what I desire. :)
@IBInspectable var placeholderTextColor:UIColor = UIColor.lightGray.withAlphaComponent(0.65) {
didSet {
if !isFirstResponder {
hintLabel.textColor = placeholderTextColor
}
}
}
I'm seeing an issue with FloatLabelTextView where the hintLabel is positioned too far down and thus clipped off until you input text into the text view. You can delete the text and it'll still appear as expected. I haven't changed the hint/title y padding. I did disable scrolling to allow it to expand in height via auto layout, not sure if that is related.
The view controller loads slowly because of using FloatLabelFields at 7 places in the VC. I searched for different solutions but none worked. Any help guys.
I have been using the same classes as provided
Thanks
Hi, everything works like a charm. Except that I cant change my placeholder text as I usually do.
override var placeholder: String? {
willSet(value) {
super.attributedPlaceholder = NSAttributedString(string: value!, attributes: [NSForegroundColorAttributeName : UIColor.whiteColor(), NSFontAttributeName : self.font])
}
}
Any ideas?
The bug is that center aligning in the textfield misplaces the title/placeholder.
But, it worked for the FloatLabelTextView.
As I didn't want to spend much time reading the logic for title placement, I just compared the setTitlePositionForTextAlignment functions in FloatLabelTextField.swift and FloatLabelTextView.swift.
Here is the fix in case anyone is looking for it:
private func setTitlePositionForTextAlignment() {
let r = textRectForBounds(bounds)
var x = r.origin.x
if textAlignment == NSTextAlignment.Center {
// x = r.origin.x + (r.size.width * 0.5) - title.frame.size.width <-- **comment out this line and add the next line.**
x = (frame.size.width - title.frame.size.width) * 0.5 // <-- add this
} else if textAlignment == NSTextAlignment.Right {
x = r.origin.x + r.size.width - title.frame.size.width
}
title.frame = CGRect(x:x, y:title.frame.origin.y, width:title.frame.size.width, height:title.frame.size.height)
}
HintY is not effect in my UITextField
I am using swift 1.2
UITextView's designated initializer is
// Create a new text view with the specified text container (can be nil) - this is the new designated initializer for this class
@availability(iOS, introduced=7.0)
init(frame: CGRect, textContainer: NSTextContainer?)
replace
override init(frame:CGRect) {
super.init(frame:frame)
setup()
}
with
override init(frame: CGRect, textContainer: NSTextContainer?) {
super.init(frame: frame, textContainer: textContainer)
setup()
}
Is it possible to animate the placeholder when the text field is clicked rather than when user starts typing the text
I tried to set the corner radius for the textfield programatically. But its not affecting for your class field. Can you check and suggest?
Thanks and Regards
Aditya B
Would you consider adding Carthage support?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.