美文网首页iOS Developer
处理UITextField和UITextView占位文字和最大文

处理UITextField和UITextView占位文字和最大文

作者: iOS开发技术 | 来源:发表于2017-03-24 12:20 被阅读33次

Demo下载

使用方式
UITextField

 self.textF.maxTextLength = 5;
 self.textF.placeHolderColor = [UIColor blueColor];
 self.textF.placeholder  = @"123";

UITextView

 self.textV.textContainerInset = UIEdgeInsetsMake(50, 0, 0, 0);
 self.textV.maxTextLength = 1000;
 self.textV.placeHolderColor = [UIColor redColor];
 self.textV.placeholder = @"fawefaw";

示例


2223.gif

相关文章

网友评论

    本文标题:处理UITextField和UITextView占位文字和最大文

    本文链接:https://www.haomeiwen.com/subject/anaxottx.html