• <small id='7iT7P'></small><noframes id='7iT7P'>

      <bdo id='7iT7P'></bdo><ul id='7iT7P'></ul>

      <legend id='7iT7P'><style id='7iT7P'><dir id='7iT7P'><q id='7iT7P'></q></dir></style></legend>

      1. <tfoot id='7iT7P'></tfoot>

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

        为 UIImageView 修饰内部

        时间:2024-04-14

          <bdo id='bCUJ5'></bdo><ul id='bCUJ5'></ul>

        • <small id='bCUJ5'></small><noframes id='bCUJ5'>

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

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

                  <tbody id='bCUJ5'></tbody>
              • <tfoot id='bCUJ5'></tfoot>
                1. 本文介绍了为 UIImageView 修饰内部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试实现类似于 Touch Up InsideUIButton 的触摸事件.我见过一些使用 touchesBegan:withEvent 的代码,但看起来我需要在屏幕上滑动一点手指.我其实只是想在图像中触摸

                  I'm trying to implement touch event similar to a Touch Up Inside a UIButton. I've seen some codes using touchesBegan:withEvent but it looks I need to slide a bit my finger over the screen. I actually just want to touch in the image

                  代码:

                  - (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {   
                      NSLog(@"Image touched!");
                  }
                  

                  问候!

                  推荐答案

                  您可以使用手势来触摸UIImageView.

                  UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc]
                                           initWithTarget:self action:@selector(ClickEventOnImage:)];
                          [tapRecognizer setNumberOfTouchesRequired:2];
                          [tapRecognizer setDelegate:self];
                          //Don't forget to set the userInteractionEnabled to YES, by default It's NO.
                          myImageView.userInteractionEnabled = YES;
                          [myImageView addGestureRecognizer:tapRecognizer];
                  

                  实现ClickEventOnImage函数.

                  -(void) ClickEventOnImage:(id) sender
                  {
                  
                  }
                  

                  这篇关于为 UIImageView 修饰内部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Swift UIImageView 拉伸方面 下一篇:如何获得自动布局来覆盖 UIImageView 的固有大小?

                  相关文章

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

                    1. <tfoot id='OB4Nu'></tfoot>

                    2. <small id='OB4Nu'></small><noframes id='OB4Nu'>

                        <bdo id='OB4Nu'></bdo><ul id='OB4Nu'></ul>