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

      <tfoot id='A6BEr'></tfoot>

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

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

        如何继承 UITableView?

        时间:2023-10-23

            <tbody id='wt0cH'></tbody>
            <legend id='wt0cH'><style id='wt0cH'><dir id='wt0cH'><q id='wt0cH'></q></dir></style></legend>

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

              • <tfoot id='wt0cH'></tfoot>
                1. 本文介绍了如何继承 UITableView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  老实说,我不知道如何子类化 UITableView.我非常困惑,正在寻找我能得到的任何帮助.如何对 UITableView 进行子类化"?我需要这样做的原因是因为我需要表格响应背景上的触摸,以便可以隐藏键盘.我试过谷歌搜索,但找不到任何东西.非常感谢任何帮助!

                  I honestly don't know how to subclass a UITableView. I'm super confused and looking for whatever help I can get. How do I go about "subclassing" a UITableView? Reason I need to do it is because I need for the table to respond to touches on the background so that keyboards can be hidden. I've tried googling but couldn't find anything. Any help is extremely appreciated!

                  推荐答案

                  大多数时候你不需要子类化 UITableView,所以先看看你是否可以避免这样做.如果您绝对必须,创建一个继承自 UITableView 的子类,并在实现中覆盖与触摸相关的方法:

                  Most of the time you shouldn't need to subclass UITableView, so see if you can avoid doing so first. If you absolutely have to, create a subclass that inherits from UITableView and override the touch-related methods in the implementation:

                  // MyTableView.h
                  
                  @interface MyTableView : UITableView {
                  }
                  
                  @end
                  
                  // MyTableView.m
                  
                  @implementation MyTableView
                  
                  - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
                      [super touchesBegan:touches withEvent:event];
                  }
                  
                  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
                      [super touchesMoved:touches withEvent:event];
                  }
                  
                  - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
                      [super touchesEnded:touches withEvent:event];
                  }
                  
                  - (void)touchesCancelled:(NSSet*)touches withEvent:(UIEvent*)event {
                      [super touchesCancelled:touches withEvent:event];
                  }
                  
                  @end
                  

                  这篇关于如何继承 UITableView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:带有字体手提箱的 iPhone 自定义字体 下一篇:Resize UIImagePickerController 视频采集界面

                  相关文章

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

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

                        <bdo id='ZL9jD'></bdo><ul id='ZL9jD'></ul>
                      <legend id='ZL9jD'><style id='ZL9jD'><dir id='ZL9jD'><q id='ZL9jD'></q></dir></style></legend>