Merge branch 'fix_searchbar_shadow' into 'rebranding'

Remove top and bottom shadow when UISearchBar is added in UITableView

See merge request new-vector/element/element-ios!10
This commit is contained in:
Steve Barré 2020-07-06 18:42:38 +00:00
commit bac171fec1
2 changed files with 14 additions and 12 deletions

View file

@ -96,18 +96,19 @@ class DarkTheme: NSObject, Theme {
}
func applyStyle(onSearchBar searchBar: UISearchBar) {
searchBar.barStyle = .default
searchBar.searchBarStyle = .default
searchBar.barStyle = .black
searchBar.barTintColor = self.baseColor
searchBar.isTranslucent = false
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
searchBar.tintColor = self.tintColor
if #available(iOS 13.0, *) {
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
searchBar.searchTextField.textColor = self.searchPlaceholderColor
searchBar.tintColor = self.tintColor
} else {
searchBar.tintColor = self.searchPlaceholderColor
if let searchBarTextField = searchBar.vc_searchTextField {
searchBarTextField.textColor = searchBar.tintColor
searchBarTextField.textColor = self.searchPlaceholderColor
}
}
}

View file

@ -104,18 +104,19 @@ class DefaultTheme: NSObject, Theme {
}
func applyStyle(onSearchBar searchBar: UISearchBar) {
searchBar.barStyle = .default
searchBar.searchBarStyle = .default
searchBar.barStyle = .black
searchBar.barTintColor = self.baseColor
searchBar.isTranslucent = false
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
searchBar.tintColor = self.tintColor
if #available(iOS 13.0, *) {
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
searchBar.searchTextField.textColor = self.searchPlaceholderColor
searchBar.tintColor = self.tintColor
} else {
searchBar.tintColor = self.searchPlaceholderColor
if let searchBarTextField = searchBar.vc_searchTextField {
searchBarTextField.textColor = searchBar.tintColor
searchBarTextField.textColor = self.searchPlaceholderColor
}
}
}