uitextfield设置占位符颜色

来源:互联网 发布:ubuntu下安装jdk8 编辑:程序博客网 时间:2024/06/05 14:42


NSMutableDictionary *attributes = [NSMutableDictionarydictionary];

    // 设置富文本对象的颜色

    attributes[NSForegroundColorAttributeName] =RGBColor(0x99,0x99, 0x99);

    // 设置UITextField的占位文字

    self.phoneNumLabeTf.attributedPlaceholder = [[NSAttributedString alloc] initWithString:@"手机号"attributes:attributes];