• 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;

  • 相关阅读:
    PAT 甲级 1128 N Queens Puzzle
    HDU 1995 R-汉诺塔V
    PAT L1-039 古风排版
    PAT L2-028 秀恩爱分得快
    ZOJ 2060 A-Fibonacci Again
    HDU 2079 选课时间
    HDU 1016 Prime Ring Problem
    理论相关概念原理
    单播字符、字符串收发
    OSAL的原理
  • 原文地址:https://www.cnblogs.com/FZP5/p/5985307.html
Copyright © 2020-2023  润新知