-(BOOL) TextView: (Uitextview *) TextView Shouldchangetextinrange: (nsrange) Range Replacementtext: (NSString *) text
{
if ([text isequaltostring:@ "\ n"]) {//detected "done"
[TextView resignfirstresponder];//release keyboard
return NO;
}
if (AdviceMsg.text.length = = 0) {//textview length is 0
if ([Text isequaltostring:@ ""]) {//To determine if the DELETE key
Labeltext.hidden = no;//hidden text
} else {
Labeltext.hidden = YES;
}
} else {//textview length is not 0
if (adviceMsg.text.length = = 1) {//textview length is 1
if ([Text isequaltostring:@ ""]) {//To determine if the DELETE key
Labeltext.hidden = NO;
} else {//Is not deleted
Labeltext.hidden = YES;
}
} else {//length is not 1 time
Labeltext.hidden = YES;
}
}
return YES;
}
Uitextview Custom placeholder Function: Write the text with a label, and then hide the label when it detects that the length is not 0