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

<small id='9pqwG'></small><noframes id='9pqwG'>

  • <tfoot id='9pqwG'></tfoot>

    • <bdo id='9pqwG'></bdo><ul id='9pqwG'></ul>
      <legend id='9pqwG'><style id='9pqwG'><dir id='9pqwG'><q id='9pqwG'></q></dir></style></legend>

        按下 UISearchBar x 按钮

        UISearchBar x button pressed(按下 UISearchBar x 按钮)
            <tbody id='mYrIn'></tbody>
          <tfoot id='mYrIn'></tfoot>

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

                <legend id='mYrIn'><style id='mYrIn'><dir id='mYrIn'><q id='mYrIn'></q></dir></style></legend>
                • <small id='mYrIn'></small><noframes id='mYrIn'>

                • 本文介绍了按下 UISearchBar x 按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  按下x"按钮时如何处理事件?

                  How handle the event when press the 'x' button?

                  我尝试了这种方法,但不起作用.

                  I try this method but not works.

                  -(void)searchBarCancelButtonClicked:(UISearchBar *)searchBar{
                  
                  }
                  

                  推荐答案

                  我不认为有一个简单的方法可以连接到 X 按钮.

                  I don't think there's an easy way to hook into the X button.

                  但是,您可以直接了解它的结果:清除文本.

                  However, you can hook into its direct consequence: cleared text.

                  试试这个:

                  func searchBar(searchBar: UISearchBar, textDidChange searchText: String) {
                      if searchText == "" {
                          print("UISearchBar.text cleared!")
                      }
                  }
                  

                  副作用是当您手动清除文本时也会调用它.

                  The side effect is this also gets called when you manually clear your text.

                  这篇关于按下 UISearchBar x 按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  iOS AutoLayout - get frame size width(iOS AutoLayout - 获取帧大小宽度)
                  Auto layout constraints issue on iOS7 in UITableViewCell(UITableViewCell中iOS7上的自动布局约束问题)
                  How to resize superview to fit all subviews with autolayout?(如何调整超级视图的大小以适应所有具有自动布局的子视图?)
                  Springs in Auto Layout: Distribute views evenly, with constraints, in Xcode 5(自动布局中的弹簧:在 Xcode 5 中使用约束均匀分布视图)
                  reloadData() of UITableView with Dynamic cell heights causes jumpy scrolling(具有动态单元格高度的 UITableView 的 reloadData() 导致跳跃滚动)
                  What is NSLayoutConstraint quot;UIView-Encapsulated-Layout-Heightquot; and how should I go about forcing it to recalculate cleanly?(什么是 NSLayoutConstraint“UIView-Encapsulated-Layout-Height?我应该如何强制它干净地重新计算?) - IT屋-程序员

                  <tfoot id='ywDIY'></tfoot>

                      <tbody id='ywDIY'></tbody>

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

                      <small id='ywDIY'></small><noframes id='ywDIY'>