修改textfield的placeholder颜色

     _textField.placeholder = @"我是占位符"; // 系统设置占位符这句必须要在前面,这样才能通过keypath 获取placeholderLabel
        UILabel *labe = (UILabel *)[_textField valueForKeyPath:@"_placeholderLabel"];
        labe.textColor = [UIColor greenColor];
        labe.textAlignment = NSTextAlignmentCenter;

猜你喜欢

转载自blog.csdn.net/LIUXIAOXIAOBO/article/details/80759687