2

I'm working with SearchDisplayController and want to apply a style or tint to the searchBar. But I noticed that the SearchDisplayController makes changes to the style of my searchBar.

For example if I use the "Dark Text Color" tint on my searchBar, when running the app, I'll obtain a grey style. But if I remove the searchDisplayController linked to the searchBar, the style in the app is ok.

This image shows the difference between the searchBar in the storyboard and in the app. difference between searchBar in the storyboard and in app

Note: If I use the default style, I don't have any problem.

I don't understand what changes the searchDisplayController adds to the searchBar. Am I missing something or doing something wrong ?

4

1 回答 1

0

不,你没有做错什么。虽然我不确定它为什么会这样工作,但我可以想象选择较浅的颜色以区分取消按钮(它将具有您的色调颜色)。

对我有用的是将背景颜色设置为黑色,无色调(默认),并使用黑色半透明样式。

另请记住,当您设置色调时,样式会被忽略。

我记得为此苦苦挣扎了几个小时,只是为了得到一个黑色的搜索栏。

于 2013-01-07T15:40:55.223 回答