// NSMutableParagraphStyle * style = [self.searchTF.defaultTextAttributes[NSParagraphStyleAttributeName] mutableCopy];
//
// style.minimumLineHeight = (self.searchTF.font.lineHeight -[UIFont systemFontOfSize:12].lineHeight)/2.0;
// self.searchTF.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"搜索" attributes:@{NSParagraphStyleAttributeName:style}];
//
// style.minimumLineHeight = (self.searchTF.font.lineHeight -[UIFont systemFontOfSize:12].lineHeight)/2.0;
// self.searchTF.attributedPlaceholder = [[NSAttributedString alloc]initWithString:@"搜索" attributes:@{NSParagraphStyleAttributeName:style}];
本文介绍如何通过修改NSMutableParagraphStyle来调整UITextField中占位符的最小行高,实现自定义显示效果。
1443

被折叠的 条评论
为什么被折叠?



