How to display the "Loading ..." gif image above the Splash image in the c lens?

I want to display a GIF image via the splash screen when the application loads its data.

I have a splash image that displays for at least about 3 or 4 seconds, so I want to show downloadable text, such as a GIF image, on top of the splash image so that users think the application is loading.

+3
source share
3 answers

just add one label to your splash image and NSTimerthat periodically change the text as shown below

splash = [[UIImageView alloc] initWithFrame:self.window.frame];
splash.image = [UIImage imageNamed:@"splash"];
[self.window addSubview:splash];

this is the code that i use to show my splash screen and then

NSTimer *loading = [[NSTimer alloc]init];
[loading performSelector:@selector(YOUR_SELECTOR) withObject:YOUR_LABEL afterDelay:0.3f];

YOUR_SELECTOR - , , YOUR_LABEL - ,

NSTimer ... application:didFinishLaunchingWithOptions:

splash = [[UIImageView alloc] initWithFrame:self.window.frame];
splash.image = [UIImage imageNamed:@"splash"];    
[self.window addSubview:splash];
hud = [[MBProgressHUD alloc]initWithView:splash];
[splash addSubview:hud];
hud.labelText = @"Loading...";
[hud show:YES];
[self performSelector:@selector(Load_FirstView) withObject:nil afterDelay:3];
[self.window makeKeyAndVisible];

Load_FirstView,

-(void)Load_FirstView
{
    [splash removeFromSuperview];
    MasterViewController *masterViewController = [[MasterViewController alloc] initWithNibName:@"MasterViewController" bundle:nil];
    self.navigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
    self.navigationController.navigationBar.tintColor = [UIColor blackColor];
    masterViewController.managedObjectContext = self.managedObjectContext;
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
}
+2

Default.png , . , . , , Default.png , .

0

Default.png, UIView, UIImageView , UIView ( ). Default.png UIImage ImageView (, UIActivityIndicatorView) .

0
source

All Articles