ios – UISearchBar最小样式在打字时会变黑

ios – UISearchBar最小样式在打字时会变黑,第1张

概述当我将UISearchBar设置为iOS7中的最小样式时,当我选择它时,色调变为黑色,并且文本是不可能读取的,因为黑色黑色. 这不会产生预期的结果.选择时色调仍为黑色… if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1){ // set bar style _sendToSearchBa 当我将UISearchbar设置为iOS7中的最小样式时,当我选择它时,色调变为黑色,并且文本是不可能读取的,因为黑色黑色.

这不会产生预期的结果.选择时色调仍为黑色…

if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_6_1){    // set bar style    _sendToSearchbar.barStyle = UIbarStyleDefault;    // set bar transparancy    _sendToSearchbar.translucent = NO;    // set bar color    _sendToSearchbar.barTintcolor = [UIcolor whitecolor];    // set bar button color    _sendToSearchbar.tintcolor = [UIcolor whitecolor];    // set bar background color    _sendToSearchbar.backgroundcolor = [UIcolor whitecolor];}
解决方法 我有同样的问题,尝试了几个小时,结论是UISearchbar是相当BUG!特别是在“最小”模式.

我的解决方法是:

>将搜索样式设置为默认(突出显示)
>将BackgroundImage(不是Backgroundcolor)设置为透明图像,或使用[UIcolor clearcolor]创建UIImage
>将barTintcolor设置为[UIcolor blackcolor]
>将Tintcolor设置为[UIcolor whitecolor]

搜索栏看起来像正常的最小模式,
当选择时背景将为白色,因此您可以看到黑色文字.

解决方法不是很完美,它只是工作,希望可以帮助.

总结

以上是内存溢出为你收集整理的ios – UISearchBar最小样式在打字时会变黑全部内容,希望文章能够帮你解决ios – UISearchBar最小样式在打字时会变黑所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1112767.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-29
下一篇 2022-05-29

发表评论

登录后才能评论

评论列表(0条)

保存