Commit ab0f186c by Daniel Dahan

updated README with TextField

parent 2bfceb08
......@@ -28,11 +28,11 @@ Run carthage to build the framework and drag the built MaterialKit.framework int
### Table of Contents
* [TextView](#textview)
* [MaterialColor](#materialcolor)
* [MaterialLayer](#materiallayer)
* [MaterialView](#materialview)
* [MaterialPulseView](#materialpulseview)
* [TextField](#textfield)
* [FlatButton](#flatbutton)
* [RaisedButton](#raisedbutton)
* [FabButton](#fabbutton)
......@@ -52,15 +52,6 @@ Run carthage to build the framework and drag the built MaterialKit.framework int
* Scrolling Techniques
* More Examples
<a name="textview"/>
### TextField
A TextField is a great option to increase UX. Below is an example.
Space on mobile devices
![MaterialKitTextField](http://www.materialkit.io/MK/MaterialKitTextField.gif)
<a name="materialcolor"/>
### MaterialColor
......@@ -125,6 +116,13 @@ materialPulseView.shadowDepth = .Depth2
view.addSubview(materialPulseView)
```
<a name="textfield"/>
### TextField
A TextField is an excellent way to improve UX. Checkout the Examples directory for a project using this component.
![MaterialKitTextField](http://www.materialkit.io/MK/MaterialKitTextField.gif)
<a name="flatbutton"/>
### FlatButton
......
......@@ -89,6 +89,7 @@ public class TextField : UITextField {
*/
internal func textFieldDidBegin(textField: TextField) {
count = text?.utf16.count
titleLabel?.text = placeholder
titleLabel?.textColor = 0 == count ? titleLabelNormalColor : titleLabelHighlightedColor
}
......@@ -152,7 +153,6 @@ public class TextField : UITextField {
v.hidden = true
v.alpha = 0
}
v.text = placeholder
let h: CGFloat = v.font.stringSize(v.text!, constrainedToWidth: Double(bounds.width)).height
v.frame = CGRectMake(0, -h, bounds.width, h)
addSubview(v)
......
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