mirror of
https://github.com/vector-im/element-ios.git
synced 2024-09-29 07:42:40 +00:00
Remove top and bottom shadow when UISearchBar is added in UITableView.
This commit is contained in:
parent
1a1c223540
commit
5347b1f0e7
2 changed files with 14 additions and 12 deletions
|
@ -94,20 +94,21 @@ class DarkTheme: NSObject, Theme {
|
||||||
// The navigation bar needs to be opaque so that its background color is the expected one
|
// The navigation bar needs to be opaque so that its background color is the expected one
|
||||||
navigationBar.isTranslucent = false
|
navigationBar.isTranslucent = false
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyStyle(onSearchBar searchBar: UISearchBar) {
|
func applyStyle(onSearchBar searchBar: UISearchBar) {
|
||||||
searchBar.barStyle = .default
|
searchBar.searchBarStyle = .default
|
||||||
|
searchBar.barStyle = .black
|
||||||
searchBar.barTintColor = self.baseColor
|
searchBar.barTintColor = self.baseColor
|
||||||
|
searchBar.isTranslucent = false
|
||||||
|
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
|
||||||
|
searchBar.tintColor = self.tintColor
|
||||||
|
|
||||||
if #available(iOS 13.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
|
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
|
||||||
searchBar.searchTextField.textColor = self.searchPlaceholderColor
|
searchBar.searchTextField.textColor = self.searchPlaceholderColor
|
||||||
searchBar.tintColor = self.tintColor
|
|
||||||
} else {
|
} else {
|
||||||
searchBar.tintColor = self.searchPlaceholderColor
|
|
||||||
|
|
||||||
if let searchBarTextField = searchBar.vc_searchTextField {
|
if let searchBarTextField = searchBar.vc_searchTextField {
|
||||||
searchBarTextField.textColor = searchBar.tintColor
|
searchBarTextField.textColor = self.searchPlaceholderColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -102,20 +102,21 @@ class DefaultTheme: NSObject, Theme {
|
||||||
// The navigation bar needs to be opaque so that its background color is the expected one
|
// The navigation bar needs to be opaque so that its background color is the expected one
|
||||||
navigationBar.isTranslucent = false
|
navigationBar.isTranslucent = false
|
||||||
}
|
}
|
||||||
|
|
||||||
func applyStyle(onSearchBar searchBar: UISearchBar) {
|
func applyStyle(onSearchBar searchBar: UISearchBar) {
|
||||||
searchBar.barStyle = .default
|
searchBar.searchBarStyle = .default
|
||||||
|
searchBar.barStyle = .black
|
||||||
searchBar.barTintColor = self.baseColor
|
searchBar.barTintColor = self.baseColor
|
||||||
|
searchBar.isTranslucent = false
|
||||||
|
searchBar.backgroundImage = UIImage() // Remove top and bottom shadow
|
||||||
|
searchBar.tintColor = self.tintColor
|
||||||
|
|
||||||
if #available(iOS 13.0, *) {
|
if #available(iOS 13.0, *) {
|
||||||
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
|
searchBar.searchTextField.backgroundColor = self.searchBackgroundColor
|
||||||
searchBar.searchTextField.textColor = self.searchPlaceholderColor
|
searchBar.searchTextField.textColor = self.searchPlaceholderColor
|
||||||
searchBar.tintColor = self.tintColor
|
|
||||||
} else {
|
} else {
|
||||||
searchBar.tintColor = self.searchPlaceholderColor
|
|
||||||
|
|
||||||
if let searchBarTextField = searchBar.vc_searchTextField {
|
if let searchBarTextField = searchBar.vc_searchTextField {
|
||||||
searchBarTextField.textColor = searchBar.tintColor
|
searchBarTextField.textColor = self.searchPlaceholderColor
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue