美文网首页
给TextView添加PlaceHolder

给TextView添加PlaceHolder

作者: 白与红与黑 | 来源:发表于2017-12-20 14:10 被阅读6次

UILabel *placeHolderLabel = [[UILabel alloc] init];

placeHolderLabel.text = @"请填写详细的街道门牌信息";

placeHolderLabel.numberOfLines = 0;

placeHolderLabel.textColor = [UIColor colorWithRed:153/255.0 green:153/255.0 blue:153/255.0 alpha:1/1.0];

[placeHolderLabel sizeToFit];

placeHolderLabel.font = [UIFont fontWithName:@"PingFangSC-Light" size:14];

[self.textView setValue:placeHolderLabel forKey:@"_placeholderLabel"];

[self.textView addSubview:placeHolderLabel];

相关文章

网友评论

      本文标题:给TextView添加PlaceHolder

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