Search code examples
iosobjective-cxlform

How to access placeholder text color of XLFormRowDescriptor


So, I know how to set the placeholder text of a XLFormRowDescriptor item:

[rowZIPCodeInput.cellConfig setObject:@"wheee" forKey:@"textField.placeholder"];

I can edit the color of the text using

[rowZIPCodeInput.cellConfig setObject:[UIColor pp_yellow] forKey:@"textLabel.textColor"];

But I can't figure out how to edit the color of the placeholder text. Is something like

[rowZIPCodeInput.cellConfig setObject:[UIColor pp_yellow] forKey:@"textField.placeholder.textColor"];

possible?


Solution

  • XLFormRowDescriptor * row = ......
    NSAttributedString *string = ....
    [row.cellConfig setObject:string forKey:@"textField.attributedPlaceholder"];
    

    https://github.com/xmartlabs/XLForm/issues/241

    use an attributed string