<tfoot id='OjyuT'></tfoot>
    1. <legend id='OjyuT'><style id='OjyuT'><dir id='OjyuT'><q id='OjyuT'></q></dir></style></legend>
    2. <small id='OjyuT'></small><noframes id='OjyuT'>

      • <bdo id='OjyuT'></bdo><ul id='OjyuT'></ul>
        <i id='OjyuT'><tr id='OjyuT'><dt id='OjyuT'><q id='OjyuT'><span id='OjyuT'><b id='OjyuT'><form id='OjyuT'><ins id='OjyuT'></ins><ul id='OjyuT'></ul><sub id='OjyuT'></sub></form><legend id='OjyuT'></legend><bdo id='OjyuT'><pre id='OjyuT'><center id='OjyuT'></center></pre></bdo></b><th id='OjyuT'></th></span></q></dt></tr></i><div id='OjyuT'><tfoot id='OjyuT'></tfoot><dl id='OjyuT'><fieldset id='OjyuT'></fieldset></dl></div>

        如何更改搜索控制器中的 uitextfield 颜色?

        how to change uitextfield color in searchcontroller?(如何更改搜索控制器中的 uitextfield 颜色?)
      1. <small id='wRtgk'></small><noframes id='wRtgk'>

          <bdo id='wRtgk'></bdo><ul id='wRtgk'></ul>
        • <i id='wRtgk'><tr id='wRtgk'><dt id='wRtgk'><q id='wRtgk'><span id='wRtgk'><b id='wRtgk'><form id='wRtgk'><ins id='wRtgk'></ins><ul id='wRtgk'></ul><sub id='wRtgk'></sub></form><legend id='wRtgk'></legend><bdo id='wRtgk'><pre id='wRtgk'><center id='wRtgk'></center></pre></bdo></b><th id='wRtgk'></th></span></q></dt></tr></i><div id='wRtgk'><tfoot id='wRtgk'></tfoot><dl id='wRtgk'><fieldset id='wRtgk'></fieldset></dl></div>

            <legend id='wRtgk'><style id='wRtgk'><dir id='wRtgk'><q id='wRtgk'></q></dir></style></legend>

                <tbody id='wRtgk'></tbody>

                <tfoot id='wRtgk'></tfoot>

                1. 本文介绍了如何更改搜索控制器中的 uitextfield 颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在导航栏中嵌入了 SearchController .如何将 UITextField 颜色更改为将搜索字符串保存为白色的颜色.?

                  i have embedded SearchController in navigation bar . How to Change UITextField Color The one which Holds search String To White .?

                  推荐答案

                  这将帮助您实现您想要的.只需在此代码中应用您的颜色组合并查看.

                  This will help you to achieve, what you want. Just apply your color combination in this code and see.

                  if #available(iOS 11.0, *) {
                              let sc = UISearchController(searchResultsController: nil)
                              sc.delegate = self
                              let scb = sc.searchBar
                              scb.tintColor = UIColor.white
                              scb.barTintColor = UIColor.white
                  
                  
                              if let textfield = scb.value(forKey: "searchField") as? UITextField {
                                  //textfield.textColor = // Set text color
                                  if let backgroundview = textfield.subviews.first {
                  
                                      // Background color
                                      backgroundview.backgroundColor = UIColor.white
                  
                                      // Rounded corner
                                      backgroundview.layer.cornerRadius = 10;
                                      backgroundview.clipsToBounds = true;
                  
                                  }
                              }
                  
                              if let navigationbar = self.navigationController?.navigationBar {
                                  navigationbar.barTintColor = UIColor.blue
                              }
                              navigationItem.searchController = sc
                              navigationItem.hidesSearchBarWhenScrolling = false
                  
                  }
                  

                  结果:

                  这篇关于如何更改搜索控制器中的 uitextfield 颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  UINavigationController inside a UITabBarController inside a UISplitViewController presented modally on iPhone(UISplitViewController 内的 UITabBarController 内的 UINavigationController 以模态方式呈现在 iPhone 上) - IT屋-程序员软件开发技术分
                  ViewController in UINavigationController orientation change(UINavigationController 中的 ViewController 方向更改)
                  Custom back button in UINavigationController(UINavigationController 中的自定义后退按钮)
                  How to add a navigation controller programmatically in code but not as initial view controller(如何在代码中以编程方式添加导航控制器,但不作为初始视图控制器)
                  The correct way to set a light status bar text color in iOS 7 based on different ViewControllers(iOS 7中基于不同ViewControllers设置灯光状态栏文字颜色的正确方法)
                  View being blocked by UITransitionView after being presented(呈现后被 UITransitionView 阻止的视图)
                  • <bdo id='1ePBs'></bdo><ul id='1ePBs'></ul>

                      <small id='1ePBs'></small><noframes id='1ePBs'>

                        <tfoot id='1ePBs'></tfoot>

                              <tbody id='1ePBs'></tbody>
                            <legend id='1ePBs'><style id='1ePBs'><dir id='1ePBs'><q id='1ePBs'></q></dir></style></legend>
                          1. <i id='1ePBs'><tr id='1ePBs'><dt id='1ePBs'><q id='1ePBs'><span id='1ePBs'><b id='1ePBs'><form id='1ePBs'><ins id='1ePBs'></ins><ul id='1ePBs'></ul><sub id='1ePBs'></sub></form><legend id='1ePBs'></legend><bdo id='1ePBs'><pre id='1ePBs'><center id='1ePBs'></center></pre></bdo></b><th id='1ePBs'></th></span></q></dt></tr></i><div id='1ePBs'><tfoot id='1ePBs'></tfoot><dl id='1ePBs'><fieldset id='1ePBs'></fieldset></dl></div>