Note that there are some explanatory texts on larger screens.

plurals
  1. POScrollView with large images scrolls too slowly
    primarykey
    data
    text
    <p>When I am scrolling images frequently in a UIScrollView then after some images, the next image takes time to load... it's not taking too much time but looks odd.</p> <p>Suppose I have 27 images in a scrollView. When I start to scroll these images, for 1 or 2 images it scrolls smoothly but when I scroll again to see the 3rd image it takes time to load. Then when I start the images scrolling again from the 3rd image, it behaves like before.</p> <p>I can't load all 27 images at a time or my app crashes.</p> <p>When I <em>slowly</em> scroll the scrollview then I don't have this problem.</p> <p>My code is below:</p> <pre><code>//Taking image view for 27 images; int x=0; for(int i = 1; i&lt;=27; i++) { imageView = [[UIImageView alloc] init]; imageView .frame = CGRectMake(x,0,768,1024); imageView.tag=i; imageView.image=nil; imageView.userInteractionEnabled=YES; [contentView addSubview:imageView]; x+=768; } //setContentOffset of the scrollView --&gt;ContentView [contentView setContentOffset: CGPointMake((imageNumber-1)*768, 0) animated: YES]; //desire image which i want to see from the start of the scrollview pageNumber=imageNumber; int pageBefore=pageNumber-1; int pageAfter=pageNumber+1; //Views for image for( UIImageView * views in [contentView subviews]){ if(views.tag==pageNumber){ if(views.image==nil){ NSLog(@"entering"); views.image=[UIImage imageNamed:[ NSString stringWithFormat:@"%d.jpg",pageNumber]]; [views.image release]; } } if(views.tag==pageBefore){ if(views.image==nil){ views.image=[UIImage imageNamed:[ NSString stringWithFormat:@"%d.jpg",pageBefore]]; [views.image release]; } } if(views.tag==pageAfter){ if(views.image==nil){ views.image=[UIImage imageNamed:[ NSString stringWithFormat:@"%d.jpg",pageAfter]]; [views.image release]; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload