alqindiirsyam 2 năm trước cách đây
mục cha
commit
5f8242b5ed

+ 3 - 0
appbuilder-ios/AppBuilder/AppBuilder/AppDelegate.swift

@@ -179,6 +179,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
         if #available(iOS 15.0, *) {
             UITabBar.appearance().scrollEdgeAppearance = tabBarAppearance
         }
+        UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).defaultTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.mainColor]
+        let cancelButtonAttributes = [NSAttributedString.Key.foregroundColor: UIColor.white]
+        UIBarButtonItem.appearance().setTitleTextAttributes(cancelButtonAttributes , for: .normal)
         return true
     }
 

+ 30 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/Extension.swift

@@ -1024,6 +1024,36 @@ class ImageCache {
     }
 }
 
+extension UISearchBar
+{
+
+    func setMagnifyingGlassColorTo(color: UIColor)
+    {
+        // Search Icon
+        let textFieldInsideSearchBar = self.value(forKey: "searchField") as? UITextField
+        let glassIconView = textFieldInsideSearchBar?.leftView as? UIImageView
+        glassIconView?.image = glassIconView?.image?.withRenderingMode(.alwaysTemplate)
+        glassIconView?.tintColor = color
+    }
+
+    func setClearButtonColorTo(color: UIColor)
+    {
+        // Clear Button
+        let textFieldInsideSearchBar = self.value(forKey: "searchField") as? UITextField
+        let crossIconView = textFieldInsideSearchBar?.value(forKey: "clearButton") as? UIButton
+        crossIconView?.setImage(crossIconView?.currentImage?.withRenderingMode(.alwaysTemplate), for: .normal)
+        crossIconView?.tintColor = color
+    }
+
+    func setPlaceholderTextColorTo(color: UIColor)
+    {
+        let textFieldInsideSearchBar = self.value(forKey: "searchField") as? UITextField
+        textFieldInsideSearchBar?.textColor = color
+        let textFieldInsideSearchBarLabel = textFieldInsideSearchBar!.value(forKey: "placeholderLabel") as? UILabel
+        textFieldInsideSearchBarLabel?.textColor = color
+    }
+}
+
 //let alert = UIAlertController(title: "", message: "\n\n\n\n\n\n\n\n\n\n".localized(), preferredStyle: .alert)
 //let newWidth = UIScreen.main.bounds.width * 0.90 - 270
 //// update width constraint value for main view

+ 2 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Chat/EditorGroup.swift

@@ -92,6 +92,8 @@ public class EditorGroup: UIViewController {
         navigationController?.navigationBar.isTranslucent = false
         navigationController?.navigationBar.backgroundColor = .mainColor
         navigationController?.navigationBar.tintColor = .white
+        navigationController?.navigationBar.overrideUserInterfaceStyle = .dark
+        navigationController?.navigationBar.barStyle = .black
         if self.navigationController?.isNavigationBarHidden ?? false {
             self.navigationController?.setNavigationBarHidden(false, animated: false)
         }

+ 3 - 0
appbuilder-ios/NexilisLite/NexilisLite/Source/View/Control/ContactChatViewController.swift

@@ -141,6 +141,9 @@ class ContactChatViewController: UITableViewController {
         searchController.searchBar.searchTextField.backgroundColor = .secondaryColor
         searchController.obscuresBackgroundDuringPresentation = false
         searchController.searchBar.placeholder = "Search".localized()
+        searchController.searchBar.setMagnifyingGlassColorTo(color: .mainColor)
+        searchController.searchBar.tintColor = .mainColor
+        
         
         navigationItem.searchController = searchController
         navigationItem.hidesSearchBarWhenScrolling = false