-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
iOS 13 下 UISearchBar.qmui_placeholderColor 在某些时机下设置时无效 #830
Labels
Comments
iOS 13 下系统的 UISearchBar.textField.attributedPlaceholder 机制有些变化,导致某些场景修改 placeholder 无效,我们再看看怎么解决。在此之前你可以尝试把 placeholderColor 的修改时机延后到 viewWillAppear: 或者 viewDidAppear: 后。 |
在新版本发布之前,可以先将以下代码添加到 UISearchBar+QMUI.m 的 +load 方法内: if (@available(iOS 13.0, *)) {
ExtendImplementationOfVoidMethodWithoutArguments([UISearchBar class], @selector(didMoveToWindow), ^(UISearchBar *selfObject) {
if (selfObject.qmui_placeholderColor) {
selfObject.placeholder = selfObject.placeholder;
}
});
} |
感谢! |
已发布 4.0.4 修复该问题。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
iOS13 UISearchBar的searchTextField.attributedPlaceholder 现在是无解吗?设置NSForegroundColor没有用
The text was updated successfully, but these errors were encountered: