There is an older version of this question for older versions of iOS no longer working due to layout changes in the UISearchBar.
I tried the following to completely remove the background color of the UISearchBar, but it does not work. (I tried to view hierarchical views, but xCode continued to fail for this option.)
private func clearBackgroundColor() {
for view in self.subviews {
view.backgroundColor = UIColor.clear
for subview in view.subviews {
subview.backgroundColor = UIColor.clear
}
}
}
Any ideas or suggestions?
Thank!!
source
share