我正在尝试更改 UISearchBar 的外观以获得以下结果
自定义搜索栏 http://imageshack.com/a/img194/3835/jhl7.png
我尝试使用 UIAppearance 方法,也尝试删除 UISearchBarBackground,但似乎无法删除文本字段的边框。
我得到的最好结果是:
问题不是放大镜,而是边框:)
我正在尝试更改 UISearchBar 的外观以获得以下结果
自定义搜索栏 http://imageshack.com/a/img194/3835/jhl7.png
我尝试使用 UIAppearance 方法,也尝试删除 UISearchBarBackground,但似乎无法删除文本字段的边框。
我得到的最好结果是:
问题不是放大镜,而是边框:)
尝试为您的搜索栏设置清晰的颜色:
[[UISearchBar appearance] setTintColor:[UIColor clearColor]];
或尝试:
UIImage *searchBg = [UIImage imageNamed:@"Search_Background.png"];
searchBg = [searchBg stretchableImageWithLeftCapWidth:10 topCapHeight:10]; //experiment with values
[[UISearchBar appearance] setSearchFieldBackgroundImage: [[UIImage imageNamed: @"background-search"];