-(void) viewdidload
{
[Super Viewdidload];
//Established in which you have complied with the < agreement uitextfielddelegate>
Self.numTF.delegate = self;
Self.passTF.delegate = self;
//Ciphertext display
Self.passTF.secureTextEntry = YES;
}
#pragma Mark-uitextfield Event Monitoring
When the input text box is going to start editing
-(BOOL) textfieldshouldbeginediting: (Uitextfield *) TextField
{
NSLog (@ "Single line input text box will start editing");
return YES;
}
When the input text box starts to enter edit mode
-(void) textfielddidbeginediting: (Uitextfield *) TextField
{
NSLog (@ "Single line input text box starts editing");
}
Called when editing is about to complete
-(BOOL) textfieldshouldendediting: (Uitextfield *) TextField
{
NSLog (@ "Single line input text box will be finished editing");
return YES;
}
When you have exited edit mode
-(void) textfielddidendediting: (Uitextfield *) TextField
{
NSLog (Called when "exiting edit mode");
Print the contents of the current TextField
NSLog (@ "%@", Textfield.text);
Show to Textlabel
Self.textLabel.text = Textfield.text;
}
This method is called when you press the return key on the keyboard
-(BOOL) Textfieldshouldreturn: (Uitextfield *) TextField
{
//Select to change the identity of the first message responder when the line enters the text box.
[SELF.NUMTF Resignfirstresponder];
[Self.passtf Resignfirstresponder];
return YES;
}
#pragma mark-font line wrapping
-(void) viewdidload
{
[Super Viewdidload];
Default Wrap Line
Self.myLabel.numberOfLines = 0;
What's displayed
nsstring *string = @ "ASDFAEATRETGFDSGFDGSDGSDGFSDGSDFGSDFGERWTEWRTYWETYHWERGHGFSHW4TYGWTRFG";
The color of the display
Self.myLabel.backgroundColor = [Uicolor Redcolor];
Show the content
Self.myLabel.text = string;
Calculate Text height (dictionary)
nsdictionary *attribute = @{nsfontattributename:self.mylabel.font};
cgsize size = [string boundingrectwithsize:cgsizemake (0) Options:nsstringdrawingtruncateslastvisib Leline | Nsstringdrawinguseslinefragmentorigin | Nsstringdrawingusesfontleading Attributes:attribute context:nil].size;
CGRect frame = self.myLabel.frame;
Frame.size.height = Size.Height;
Self.myLabel.frame = frame;
}
iOS Note Uikit_uitextfield