iOS修改TextField占位符颜色大小

    UITextField *addCtrolField = [[UITextField alloc]initWithFrame:CGRectMake(CGRectGetMaxX(rightTitleLableEND.frame) + 5, 5, FirstTwoView.width - rightTitleLableEND.width - 5, FirstTwoView.height - 10)];

    addCtrolField.layer.borderColor = [UIColor blackColor].CGColor;

    addCtrolField.layer.borderWidth = 0.5;

    addCtrolField.textColor = [UIColor greenColor];

    addCtrolField.textAlignment = NSTextAlignmentCenter;

    addCtrolField.font = [UIFont fontWithName:boldgeshi size:22];

    [FirstTwoView addSubview:rightTitleLableEND];

    [FirstTwoView addSubview:addCtrolField];

    //修改占位符内容

    NSString *holderText = @"0.0000";

    NSMutableAttributedString *placeholder = [[NSMutableAttributedString alloc]initWithString:holderText];

    [placeholder addAttribute:NSForegroundColorAttributeName

                       value:[UIColor greenColor]

                       range:NSMakeRange(0, holderText.length)];

    [placeholder addAttribute:NSFontAttributeName

                       value:[UIFont boldSystemFontOfSize:22]

                       range:NSMakeRange(0, holderText.length)];

    addCtrolField.attributedPlaceholder = placeholder;

原文地址:https://www.cnblogs.com/FZP5/p/5985307.html