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

        <legend id='9tM4S'><style id='9tM4S'><dir id='9tM4S'><q id='9tM4S'></q></dir></style></legend>
      1. <small id='9tM4S'></small><noframes id='9tM4S'>

          <bdo id='9tM4S'></bdo><ul id='9tM4S'></ul>

        从动画 UIImageView 获取图像

        Fetching image From Animating UIImageView(从动画 UIImageView 获取图像)
      2. <tfoot id='cKqt4'></tfoot>
        • <bdo id='cKqt4'></bdo><ul id='cKqt4'></ul>

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

                    <tbody id='cKqt4'></tbody>

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

                • <legend id='cKqt4'><style id='cKqt4'><dir id='cKqt4'><q id='cKqt4'></q></dir></style></legend>
                • 本文介绍了从动画 UIImageView 获取图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用动画方法在 UIimageView 中实现幻灯片放映:

                  I'm using animation method of for implementing slide show in UIimageView as:

                  mainSlideShowImageView.animationImages=images;
                  mainSlideShowImageView.animationDuration = 75.00; 
                  mainSlideShowImageView.animationRepeatCount = 0; //infinite
                  [mainSlideShowImageView startAnimating];
                  

                  现在,我想知道哪个图像当前在图像视图屏幕上.

                  Now, what I want is to know which image is currently on image view screen.

                  我该怎么做?

                  如果不可能,也请告诉.

                  If it is not possible please tell that too.

                  'images' 这里是 UIImage 数组.

                  'images' here is array of UIImage.

                  推荐答案

                  AFAIK,没有返回 imageview 的当前图像的方法,但是我已经为此创建了一个解决方法....

                  AFAIK, there is no method which returns imageview's current image , however I have created a workaround for this....

                  array= [NSArray arrayWithObjects:[UIImage imageNamed:@"1.jpg"],[UIImage imageNamed:@"2.jpg"],[UIImage imageNamed:@"3.jpg"],[UIImage imageNamed:@"4.jpg"],[UIImage imageNamed:@"5.jpg"],nil];
                  mainSlideShowImageView.animationImages= array;
                  mainSlideShowImageView.animationDuration=15.0;
                  i=0;
                  timer = [NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(increase) userInfo:nil repeats:YES];
                  [mainSlideShowImageView startAnimating];
                  
                  -(void)increase
                  {
                      i++;
                      if (i>4) {
                          i=0;
                      }
                  }
                  
                  -(void)getimage
                  {
                      UIImage* im = [array objectAtIndex:i];
                          // im is the current image of imageview
                  
                  }
                  

                  我在这里拍摄了 5 张图像,动画持续时间为 15 ,这意味着图像将每 3 秒更改一次,所以我让计时器每 3 秒触发一次……并且由于数组包含 5 张图像……所以如果'i' 超过 4 我在方法增加中将其放回 0

                  I have taken 5 images here and animation duration of 15 , that means image will change at every 3 seconds, so I have kept timer to fire at every 3 seconds ... and since array contains 5 images ... so if 'i' goes beyond 4 I have put it back to 0 in method increase

                  这篇关于从动画 UIImageView 获取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Getting an NSArray of a single attribute from an NSArray(从 NSArray 获取单个属性的 NSArray)
                  ImageIO: lt;ERRORgt; JPEG Corrupt JPEG data: premature end of data segment iphone - how to catch this?(ImageIO:lt;错误gt;JPEG 损坏的 JPEG 数据:iphone 数据段过早结束 - 如何捕捉到这个?)
                  How to get indexPath.row of tableView which is currently being displayed?(如何获取当前正在显示的 tableView 的 indexPath.row?)
                  Xcode iOS organizer submit to app store yields quot;The archive is invalidquot; error(Xcode iOS 管理器提交到应用商店产生“存档无效;错误)
                  MFMessageComposeViewController alloc returns nil(MFMessageComposeViewController alloc 返回 nil)
                  How to add and get the values from .plist in iOS(如何在 iOS 中从 .plist 添加和获取值)
                • <tfoot id='chXiC'></tfoot>
                  • <bdo id='chXiC'></bdo><ul id='chXiC'></ul>
                    • <legend id='chXiC'><style id='chXiC'><dir id='chXiC'><q id='chXiC'></q></dir></style></legend>

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

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

                              <tbody id='chXiC'></tbody>