Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6647659
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:33:48+00:00 2026-05-26T00:33:48+00:00

i m pulling an image from an url and showing it in an imageview.what

  • 0

i m pulling an image from an url and showing it in an imageview.what i want is an fadein animation effect when the image gets loaded from the url.i m using a background threading below is the code..

    NSOperationQueue *theQueue=[[[NSOperationQueue alloc]init]autorelease];

    NSInvocationOperation *theOp=[[NSInvocationOperation alloc]initWithTarget:self selector:@selector(loadImage) object:nil]; 

    [theQueue addOperation:theOp];  
}

-(void)loadImage
{

    NSAutoreleasePool *pool=[[NSAutoreleasePool alloc]init];
    [activityIndicator startAnimating];
    NSString *imagefile = [image  objectAtIndex:0]; 
    NSURL *url1=[NSURL URLWithString:imagefile];
    NSData *data = [NSData dataWithContentsOfURL:url1];
    UIImage *ui=[[UIImage alloc]initWithData:data];
    NSLog(@"awesome:%@",ui);
    [ui beginAnimations:@"" context:nil];
    bigbanner.image=ui;
    [activityIndicator stopAnimating];
    [pool release];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T00:33:49+00:00Added an answer on May 26, 2026 at 12:33 am

    Yes what you say is absolutely correct and thats the way to do it. I wrote this method & always use this to Fade in my image. I deal with CALayer for this. You need to import Quartz framework for this.

    #import <QuartzCore/QuartzCore.h>
    
    ...
    
    - (void)fadeInLayer:(CALayer *)l
    {
        CABasicAnimation *fadeInAnimate   = [CABasicAnimation animationWithKeyPath:@"opacity"];
        fadeInAnimate.duration            = 0.5;
        fadeInAnimate.repeatCount         = 1;
        fadeInAnimate.autoreverses        = NO;
        fadeInAnimate.fromValue           = [NSNumber numberWithFloat:0.0];
        fadeInAnimate.toValue             = [NSNumber numberWithFloat:1.0];
        fadeInAnimate.removedOnCompletion = YES;
        [l addAnimation:fadeInAnimate forKey:@"animateOpacity"];
        return;
    }
    

    Usage: If you are using this from your current file, then –

        [self fadeInLayer:imageView.layer];
    

    Hope this helps

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am pulling a long timestamp from a database, but want to present it
I'm pulling email address records from a table in SQL Server 2005, and want
What I'm doing I'm pulling an image from the database and sending it to
I need help displaying this image which I'm pulling from a JSON server. JSON
I am pulling an image from the web and adding it to a FixedDocument
I am trying to pass an image loaded from a UIImage instance to a
I am pulling in a URL from an XML file which leads with the
I have my jquery mobile app pulling data from our mysql db using JSONP.
When viewing this url http://dl.dropbox.com/u/1550420/jquery/flickr.html , we see a list of images pulling from
I'm pulling back a Date and a Time from a database. They are stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.