<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 颜色?

        时间:2023-06-12
      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 颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 iOS 11 上调整 UI 导航 下一篇:UINavigationController 不弹出 UINavigationBar 项目

                  相关文章

                  • <bdo id='1ePBs'></bdo><ul id='1ePBs'></ul>

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

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

                      <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>