久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

    • <bdo id='WBttG'></bdo><ul id='WBttG'></ul>

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

    <tfoot id='WBttG'></tfoot>

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

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

        如何通過點擊動畫 UIImageview 以顯示全屏?

        How to animate a UIImageview to display fullscreen by tapping on it?(如何通過點擊動畫 UIImageview 以顯示全屏?)
        <i id='btDLV'><tr id='btDLV'><dt id='btDLV'><q id='btDLV'><span id='btDLV'><b id='btDLV'><form id='btDLV'><ins id='btDLV'></ins><ul id='btDLV'></ul><sub id='btDLV'></sub></form><legend id='btDLV'></legend><bdo id='btDLV'><pre id='btDLV'><center id='btDLV'></center></pre></bdo></b><th id='btDLV'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='btDLV'><tfoot id='btDLV'></tfoot><dl id='btDLV'><fieldset id='btDLV'></fieldset></dl></div>

          <legend id='btDLV'><style id='btDLV'><dir id='btDLV'><q id='btDLV'></q></dir></style></legend>
          <tfoot id='btDLV'></tfoot>

              <tbody id='btDLV'></tbody>
          • <small id='btDLV'></small><noframes id='btDLV'>

                • <bdo id='btDLV'></bdo><ul id='btDLV'></ul>
                  本文介紹了如何通過點擊動畫 UIImageview 以顯示全屏?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  限時送ChatGPT賬號..

                  我在 UITableviewCell 中有一個 UIImageView.當它被點擊時, UIImageView 應(yīng)該動畫以全屏顯示.當圖像在全屏?xí)r被點擊時,它應(yīng)該收縮回原來的位置.

                  I have an UIImageView in a UITableviewCell. When it is tapped, the UIImageView should animated to be displayed fullscreen. When the image is tapped when it is fullscreen it should shrink back to the original position.

                  如何做到這一點?

                  推薦答案

                  向視圖控制器添加手勢識別器.

                  Add a gesture recognizer to the view controller.

                  將手勢識別器添加到您的頭文件中

                  Add the gesture Recognizer to your header file

                  @interface viewController : UIViewController <UIGestureRecognizerDelegate>{
                      UITapGestureRecognizer *tap;
                      BOOL isFullScreen;
                      CGRect prevFrame;
                  }
                  

                  在你的 viewDidLoad 中添加這個:

                  In your viewDidLoad add this:

                  isFullScreen = false;
                  tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(imgToFullScreen)];
                  tap.delegate = self;
                  

                  添加以下委托方法:

                  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
                  {
                      BOOL shouldReceiveTouch = YES;
                  
                      if (gestureRecognizer == tap) {
                          shouldReceiveTouch = (touch.view == yourImageView);
                      }
                      return shouldReceiveTouch;
                  }
                  

                  現(xiàn)在您只需要實現(xiàn)您的 imgToFullScreen 方法.確保使用 isFullScreen Bool(如果為 false,則為全屏,如果為 true,則返回舊尺寸)

                  Now you just need to implement your imgToFullScreen method. Make sure you work with the isFullScreen Bool (fullscreen if it is false and back to old size if it's true)

                  imgToFullScreen 方法取決于您希望如何使圖像變?yōu)槿?一種方法是:(這是未經(jīng)測試的,但應(yīng)該可以工作)

                  The imgToFullScreen method depends on how you want to make the image become fullscreen. One way would be: (this is untested but should work)

                  -(void)imgToFullScreen{
                      if (!isFullScreen) {
                          [UIView animateWithDuration:0.5 delay:0 options:0 animations:^{
                              //save previous frame
                              prevFrame = yourImageView.frame;
                              [yourImageView setFrame:[[UIScreen mainScreen] bounds]];
                          }completion:^(BOOL finished){
                              isFullScreen = true;
                          }];
                          return;
                      } else {
                          [UIView animateWithDuration:0.5 delay:0 options:0 animations:^{
                              [yourImageView setFrame:prevFrame];
                          }completion:^(BOOL finished){
                              isFullScreen = false;
                          }];
                          return;
                      }
                  }
                  

                  這篇關(guān)于如何通過點擊動畫 UIImageview 以顯示全屏?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  To stop segue and show alert(停止 segue 并顯示警報)
                  iOS 5 storyboard, programmatically determine path(iOS 5 故事板,以編程方式確定路徑)
                  Icon already includes gloss effects(圖標已經(jīng)包含光澤效果)
                  How does UIEdgeInsetsMake work?(UIEdgeInsetsMake 是如何工作的?)
                  UIProgressView and Custom Track and Progress Images (iOS 5 properties)(UIProgressView 和自定義跟蹤和進度圖像(iOS 5 屬性))
                  drawRect circle and animate size/color(drawRect 圓和動畫大小/顏色)
                    <bdo id='IYRyt'></bdo><ul id='IYRyt'></ul>
                  • <small id='IYRyt'></small><noframes id='IYRyt'>

                  • <legend id='IYRyt'><style id='IYRyt'><dir id='IYRyt'><q id='IYRyt'></q></dir></style></legend>

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

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

                            <tbody id='IYRyt'></tbody>

                            主站蜘蛛池模板: 91丨九色丨国产在线 | 久久婷婷香蕉热狠狠综合 | 国产伦精品一区二区三区高清 | 欧美一级小视频 | 国产一区欧美 | 欧美日韩毛片 | www.婷婷 | 日韩欧美成人一区二区三区 | 国产高清在线视频 | 性一交一乱一透一a级 | 久草a√| 精品国产乱码久久久久久丨区2区 | 免费日本视频 | 久久久久亚洲 | 在线黄av | 天天精品综合 | 看片网站在线 | 亚洲国产视频一区二区 | 色天天综合 | 国产高清免费视频 | 日韩免费中文字幕 | 国产精品久久国产精品 | 日韩欧美不卡 | 美女毛片| 国产精品五区 | 久久久久久久久久久久久久久久久久久久 | 国产一区三区在线 | 免费啪啪 | 91网站在线播放 | 中文字幕一区二区三区日韩精品 | 国产精品色 | 自拍偷拍第一页 | 亚洲欧美精品在线观看 | 可以免费观看的av | 精品久久一区 | 欧美一区二 | 拍真实国产伦偷精品 | 欧美日韩在线不卡 | 老司机午夜性大片 | 成人在线精品 | 成人精品鲁一区一区二区 |