在 UISearchDisplayController 中设置 UISearchBar 的边框颜色
我的 xib 包含一个 UITableView 和一个 UISearchDisplayController。我正在设置颜色,但搜索栏遇到了一些问题。
我将其颜色设置如下:
self.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];
表中的部分标题设置为相同的颜色。
存在三个问题:
- 顶部之间有明显的(可能是 1 px)白色条纹 搜索栏和导航栏
- 之间有类似的黑色条纹 搜索栏的底部和第一个部分标题 表,
- 即使搜索栏和节标题相同 颜色,搜索栏显得稍暗 有
没有一种技术可以使其看起来正确/更好?
编辑:它看起来像这样:
My xib contains a UITableView and a UISearchDisplayController. I'm setting colors and having a bit of trouble with the search bar.
I'm setting its color like this:
self.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.0 green:0.0 blue:0.0 alpha:0.5];
The section headers in the table are set to the same color.
There are three problems:
- there's a noticeable (probably 1 px) white stripe between the top of
the search bar and the nav bar - there's a similar black stripe between
the bottom of the search bar and the first section header in the
table - even though the search bar and section headers are the same
color, the search bar appears slightly darker
Is there a technique for making this look right/better?
Edit: here's what it looks like:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
顺便说一句,你必须两者都做。仅设置 borderColor 属性对我来说不起作用!
Try this one:
By the way you have to do both. Setting just borderColor property didn't work for me!