UISearchBar去掉底部黑线

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/cuihaiyang/article/details/61419145

UISearchBar SearchStyle默认样式时底部有条黑线,跟页面设计不搭。


去掉有两种方式,ios10下亲测有效:

1、SearchStyle选择UISearchBarStyleDefault(等价于UISearchBarStyleProminent)时,去掉Scope Titles,并设置BackgroundImage

[_searchBar setBackgroundImage:[UIImage new]];

效果如下:


2、SearchStyle选择UISearchBarStyleMinimal,效果如下:



猜你喜欢

转载自blog.csdn.net/cuihaiyang/article/details/61419145