最近发现修改 searchBar 背景颜色后,出现了两条黑线,后来试了这种方法就可以了,博爱就共享给大家了,以后遇到的话记得来找博爱哈!
UIImageView *barImageView = [[[self.searchBar.subviews firstObject] subviews] firstObject];
barImageView.layer.borderColor = KCOLOR(248,248,248,1).CGColor;
barImageView.layer.borderWidth = 1;