|
LuxChat
2.0
Instant messenger for iOS
|
#import <JVFloatLabeledTextView.h>
Instance Methods | |
| (void) | - setPlaceholder:floatingTitle: |
Properties | |
| IBInspectable NSString * | placeholder |
| UILabel * | placeholderLabel |
| UILabel * | floatingLabel |
| IBInspectable CGFloat | floatingLabelYPadding |
| IBInspectable CGFloat | floatingLabelXPadding |
| IBInspectable CGFloat | placeholderYPadding |
| UIFont * | floatingLabelFont |
| IBInspectable UIColor * | floatingLabelTextColor |
| IBInspectable UIColor * | floatingLabelActiveTextColor |
| IBInspectable BOOL | floatingLabelShouldLockToTop |
| IBInspectable UIColor * | placeholderTextColor |
| IBInspectable BOOL | animateEvenIfNotFirstResponder |
| NSTimeInterval floatingLabelShowAnimationDuration | UI_APPEARANCE_SELECTOR |
| NSTimeInterval floatingLabelHideAnimationDuration | UI_APPEARANCE_SELECTOR |
JVFloatLabeledTextView is a UITextView 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.
JVFloatLabeledTextView aims to improve the user experience by having placeholders transition into "floating labels" that hover above the text view after it is populated with text.
JVFloatLabeledTextView supports iOS 7+.
Credits for the concept to Matt D. Smith (), and his original design: http://mattdsmith.com/float-label-pattern/
| - (void) setPlaceholder: | (NSString *) | placeholder | |
| floatingTitle: | (NSString *) | floatingTitle | |
Sets the placeholder and the floating title
| placeholder | The string that to be shown in the text view when no other text is present. |
| floatingTitle | The string to be shown above the text view once it has been populated with text by the user. |
|
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.
|
readnonatomicstrong |
Read-only access to the floating label.
|
readwritenonatomicstrong |
Text color to be applied to the floating label while the text view is a first responder. Tint color is used by default if an floatingLabelActiveTextColor is not provided.
|
readwritenonatomicstrong |
Font to be applied to the floating label. Defaults to [UIFont boldSystemFontOfSize:12.0f]. Provided for the convenience of using as an appearance proxy.
|
readwritenonatomicassign |
Indicates whether the floating label should lock to the top of the text view, or scroll away with text when the text view is scrollable. By default, floating labels will lock to the top of the text view and their background color will be set to the text view's background color Note that this works best when floating labels have a non-clear background color.
|
readwritenonatomicstrong |
Text color to be applied to the floating label while the text view is not a first responder. Defaults to [UIColor grayColor]. Provided for the convenience of using as an appearance proxy.
|
readwritenonatomicassign |
Padding to be applied to the x coordinate of the floating label upon presentation.
|
readwritenonatomicassign |
Padding to be applied to the y coordinate of the floating label upon presentation.
|
readwritenonatomiccopy |
The placeholder string to be shown in the text view when no other text is present.
|
readnonatomicstrong |
Read-only access to the placeholder label.
|
readwritenonatomicstrong |
Text color to be applied to the placeholder. Defaults to [[UIColor lightGrayColor] colorWithAlphaComponent:0.65f].
|
readwritenonatomicassign |
Padding to be applied to the y coordinate of the placeholder.
|
readwritenonatomicassign |
Duration of the animation when showing the floating label. Defaults to 0.3 seconds.
|
readwritenonatomicassign |
Duration of the animation when hiding the floating label. Defaults to 0.3 seconds.
1.8.9.1