LuxChat  2.0
Instant messenger for iOS
Instance Methods | Properties | List of all members
JVFloatLabeledTextField Class Reference

#import <JVFloatLabeledTextField.h>

Inheritance diagram for JVFloatLabeledTextField:

Instance Methods

(void) - setPlaceholder:floatingTitle:
 

Properties

UILabel * floatingLabel
 
IBInspectable CGFloat floatingLabelYPadding
 
IBInspectable CGFloat floatingLabelXPadding
 
IBInspectable CGFloat placeholderYPadding
 
UIFont * floatingLabelFont
 
IBInspectable UIColor * floatingLabelTextColor
 
IBInspectable UIColor * floatingLabelActiveTextColor
 
IBInspectable BOOL animateEvenIfNotFirstResponder
 
NSTimeInterval floatingLabelShowAnimationDuration
 
NSTimeInterval floatingLabelHideAnimationDuration
 
IBInspectable BOOL adjustsClearButtonRect
 
IBInspectable BOOL keepBaseline
 

Detailed Description

JVFloatLabeledTextField is a UITextField subclass that implements the "Float Label Pattern".

Due to space constraints on mobile devices, it is common to rely solely on placeholders as a means to label fields. This presents a UX problem, in that, once the user begins to fill out a form, no labels are present.

JVFloatLabeledTextField aims to improve the user experience by having placeholders transition into "floating labels" that hover above the text field after it is populated with text.

JVFloatLabeledTextField supports iOS 6+.

Credits for the concept to Matt D. Smith (), and his original design: http://mattdsmith.com/float-label-pattern/

Method Documentation

- (void) setPlaceholder: (NSString *)  placeholder
floatingTitle: (NSString *)  floatingTitle 

Sets the placeholder and the floating title

Parameters
placeholderThe string that to be shown in the text field when no other text is present.
floatingTitleThe string to be shown above the text field once it has been populated with text by the user.

Property Documentation

- (IBInspectable BOOL) adjustsClearButtonRect
readwritenonatomicassign

Indicates whether the clearButton position is adjusted to align with the text Defaults to 1.

- (IBInspectable BOOL) animateEvenIfNotFirstResponder
readwritenonatomicassign

Indicates whether the floating label's appearance should be animated regardless of first responder status. By default, animation only occurs if the text field is a first responder.

- (UILabel*) floatingLabel
readnonatomicstrong

Read-only access to the floating label.

- (IBInspectable UIColor*) floatingLabelActiveTextColor
readwritenonatomicstrong

Text color to be applied to the floating label while the field is a first responder. Tint color is used by default if an floatingLabelActiveTextColor is not provided.

- (UIFont*) floatingLabelFont
readwritenonatomicstrong

Font to be applied to the floating label. Defaults to the first applicable of the following:

  • the custom specified attributed placeholder font at 70% of its size
  • the custom specified textField font at 70% of its size
- (NSTimeInterval) floatingLabelHideAnimationDuration
readwritenonatomicassign

Duration of the animation when hiding the floating label. Defaults to 0.3 seconds.

- (NSTimeInterval) floatingLabelShowAnimationDuration
readwritenonatomicassign

Duration of the animation when showing the floating label. Defaults to 0.3 seconds.

- (IBInspectable UIColor*) floatingLabelTextColor
readwritenonatomicstrong

Text color to be applied to the floating label. Defaults to [UIColor grayColor].

- (IBInspectable CGFloat) floatingLabelXPadding
readwritenonatomicassign

Padding to be applied to the x coordinate of the floating label upon presentation. Defaults to zero

- (IBInspectable CGFloat) floatingLabelYPadding
readwritenonatomicassign

Padding to be applied to the y coordinate of the floating label upon presentation. Defaults to zero.

- (IBInspectable BOOL) keepBaseline
readwritenonatomicassign

Indicates whether or not to drop the baseline when entering text. Setting to YES (not the default) means the standard greyed-out placeholder will be aligned with the entered text Defaults to NO (standard placeholder will be above whatever text is entered)

- (IBInspectable CGFloat) placeholderYPadding
readwritenonatomicassign

Padding to be applied to the y coordinate of the placeholder. Defaults to zero.


The documentation for this class was generated from the following files: