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

    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设置垂直居中和颜色字体等)