Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS13 UITextField的占位文字颜色修改问题 #15

Open
obama901 opened this issue Sep 24, 2019 · 2 comments
Open

iOS13 UITextField的占位文字颜色修改问题 #15

obama901 opened this issue Sep 24, 2019 · 2 comments

Comments

@obama901
Copy link

之前可以通过kvc的私有方法获取到占位文字的UIlabel,但是现在不可以了,有什么解决办法吗?

@coderchou
Copy link

iOS 13禁止通过KVC设置placeholderLabel属性

//以下代码会崩溃
UIColor * color = [UIColor greenColor];
[textField setValue:color forKeyPath:@"_placeholderLabel.textColor"];

iOS 13系统直接设置 UITextFieldattributedPlaceholder 属性

@obama901
Copy link
Author

所以直接改attributedPlaceholder,要怎么和SakuraKit结合起来啊,之前获取Label可以用SakuraKit设置颜色,SakuraKit能设置NSAttributedString的颜色吗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants