TextField placeholder Tip information Floating
The placeholder information floats to the upper-left corner when the input box has a text.
As long as the inheritance on the line, without additional calling code, the use is very simple.
Tintfloatfield
Code calls are simple
#import "RPFloatingPlaceholderTextField.h" #import "RPFloatingPlaceholderTextView.h" @interface Viewcontroller () @ Property (weak, nonatomic) Iboutlet Rpfloatingplaceholdertextfield *titlefield; @property (weak, nonatomic) Iboutlet Rpfloatingplaceholdertextfield *detailfield; @property (weak, nonatomic) Iboutlet Rpfloatingplaceholdertextfield * Localfield; @property (weak, nonatomic) Iboutlet Rpfloatingplaceholdertextfield *cityfield; @property (weak, nonatomic) Iboutlet Rpfloatingplaceholdertextview *describetextview, @end @implementation viewcontroller-(void) ViewDidLoad {[ Super Viewdidload]; Additional setup after loading the view, typically from a nib. Self.titleField.floatingLabelActiveTextColor = [Uicolor Redcolor]; Self.titleField.floatingLabelInactiveTextColor = [Uicolor Bluecolor]; Self.detailField.floatingLabelActiveTextColor = [Uicolor Redcolor]; Self.detailField.floatingLabelInactiveTextColor = [Uicolor Bluecolor]; Self.localfield.fLoatinglabelactivetextcolor = [Uicolor Redcolor]; Self.localField.floatingLabelInactiveTextColor = [Uicolor Bluecolor]; Self.cityField.floatingLabelActiveTextColor = [Uicolor Redcolor]; Self.cityField.floatingLabelInactiveTextColor = [Uicolor Bluecolor]; Self.describeTextView.placeholder = @ "describe"; Self.describeTextView.floatingLabelActiveTextColor = [Uicolor Redcolor]; Self.describeTextView.floatingLabelInactiveTextColor = [Uicolor Bluecolor]; Self.describeTextView.layer.borderColor = [Uicolor blackcolor]. Cgcolor; Self.describeTextView.layer.borderWidth = 1; } @end
GitHub Address: Https://github.com/lc081200/tintFloatField
iOS App TextField placeholder information floating