<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 获取图像

        时间:2023-10-23
      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 获取图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:sigabrt 没有错误信息 下一篇:未找到 -L 之后的目录“X"

                  相关文章

                • <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>