zoukankan      html  css  js  c++  java
  • 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;

  • 相关阅读:
    A. Greg and Array 夜
    zoj 2314 Reactor Cooling 夜
    sgu 104. Little shop of flowers 夜
    C. Greg and Friends 夜
    sgu 103. Traffic Lights 夜
    B. Greg and Graph 夜
    B. Yaroslav and Two Strings 夜
    zoj 2313 Chinese Girls' Amusement 夜
    sgu 101. Domino 夜
    hdu 4532 湫秋系列故事——安排座位 夜
  • 原文地址:https://www.cnblogs.com/FZP5/p/5985307.html
Copyright © 2011-2022 走看看