美文网首页
PlaceHolder设置垂直居中和颜色字体等

PlaceHolder设置垂直居中和颜色字体等

作者: ___1o_8o | 来源:发表于2016-08-03 16:01 被阅读565次
    NSMutableParagraphStyle *style = [searchTF.defaultTextAttributes[NSParagraphStyleAttributeName] mutableCopy];
    style.minimumLineHeight = searchTF.font.lineHeight - (searchTF.font.lineHeight - [UIFont systemFontOfSize:18].lineHeight) / 2.0;
    searchTF.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"请拨号或点击搜索姓名" attributes:@{NSForegroundColorAttributeName:[UIColor colorWithRed:0.80 green:0.86 blue:0.85 alpha:1.00],NSFontAttributeName:[UIFont systemFontOfSize:18],NSParagraphStyleAttributeName:style}];

相关文章

网友评论

      本文标题:PlaceHolder设置垂直居中和颜色字体等

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