Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try my custom coding : you can change image as per requirement.</p> <p>.h file</p> <pre><code> //ProgressBar NSTimer *splashtimer; UIImage *ProgressBarBackgroundImage; UIImageView *ProgressBarLeft; UIImageView *ProgressBarRight; UIImageView *ProgressBarMiddle; UIImageView *LoadingBackground; NSInteger totalSizeOfProgressBarAnimation; NSInteger totalCountOfProgressBarAnimation; NSInteger NoOfPercentage; NSInteger startingvalue; int progressValue; //ProgressBar @property (nonatomic,retain) UIImageView *ProgressBarLeft; @property (nonatomic,retain) UIImageView *ProgressBarRight; @property (nonatomic,retain) UIImageView *ProgressBarMiddle; @property (nonatomic,retain) UIImageView *LoadingBackground; - (void) ProgressBarSizeCheck:(NSInteger)starting:(NSInteger)ending; </code></pre> <p>.m file</p> <pre><code> @synthesize ProgressBarLeft,ProgressBarRight,ProgressBarMiddle,LoadingBackground; - (void)viewDidLoad { [super viewDidLoad] splashtimer = [NSTimer scheduledTimerWithTimeInterval: 0.75 target: self selector: @selector(startMoveProgress) userInfo: nil repeats: NO]; ProgressBarLeft = [[UIImageView alloc] init]; ProgressBarMiddle = [[UIImageView alloc] init]; ProgressBarRight = [[UIImageView alloc] init]; LoadingBackground = [[UIImageView alloc] init]; ProgressBarBackgroundImage = [UIImage imageNamed: @"loaderbg.png"]; [self.view addSubview: LoadingBackground]; } </code></pre> <h1>pragma mark -</h1> <h1>pragma mark Progress Bar Method</h1> <pre><code> -(void)ProgressBarSizeCheck:(NSInteger)starting:(NSInteger)ending { startingvalue = starting; endingValue = ending; NoOfPercentage = ending - starting; if (startingvalue==0) { //ProgressBarLeft Image ProgressBarLeft.frame = CGRectMake(23,410,10,20); UIImage *ProgressBarImage = [UIImage imageNamed: @"loaderleftpart.png"]; ProgressBarLeft.image = ProgressBarImage; [self.view addSubview: ProgressBarLeft]; //LeftImageOver //ProgressBarMiddleImage ProgressBarMiddle.frame = CGRectMake(33,410,0,20); UIImage *ProgressBarImageMiddle = [UIImage imageNamed: @"loadercenterpart.png"]; ProgressBarMiddle.image = ProgressBarImageMiddle; [self.view addSubview: ProgressBarMiddle]; //MiddleImageOver //ProgressBarRightImage ProgressBarRight.frame = CGRectMake(33,410,10,20); UIImage *ProgressBarImageRight = [UIImage imageNamed: @"loaderrightpart.png"]; ProgressBarRight.image = ProgressBarImageRight; [self.view addSubview: ProgressBarRight]; //RightImageOver totalSizeOfProgressBarAnimation = 276 * NoOfPercentage / 100; totalSizeOfProgressBarAnimation=totalSizeOfProgressBarAnimation-20; int Duration=NoOfPercentage/10; [self moveDown:Duration:totalSizeOfProgressBarAnimation]; } else { totalSizeOfProgressBarAnimation = 276 * startingvalue / 100; totalSizeOfProgressBarAnimation=totalSizeOfProgressBarAnimation-20; //ProgressBarLeftImage ProgressBarLeft.frame = CGRectMake(23,410,10,20); UIImage *ProgressBarImage = [UIImage imageNamed: @"loaderleftpart.png"]; ProgressBarLeft.image = ProgressBarImage; [self.view addSubview: ProgressBarLeft]; //LeftImageOver //ProgressbarMiddleImage ProgressBarMiddle.frame = CGRectMake(33,410,totalSizeOfProgressBarAnimation,20); UIImage *ProgressBarImageMiddle = [UIImage imageNamed: @"loadercenterpart.png"]; ProgressBarMiddle.image = ProgressBarImageMiddle; [self.view addSubview: ProgressBarMiddle]; //MiddleImageOver //ProgressBarRightImage ProgressBarRight.frame = CGRectMake(33+totalSizeOfProgressBarAnimation,410,10,20); UIImage *ProgressBarImageRight = [UIImage imageNamed: @"loaderrightpart.png"]; ProgressBarRight.image = ProgressBarImageRight; [self.view addSubview: ProgressBarRight]; //RightImageOver totalSizeOfProgressBarAnimation = 276 * NoOfPercentage / 100; int Duration=NoOfPercentage/10; [self moveDown:Duration:totalSizeOfProgressBarAnimation]; } } -(void)moveDown:(NSInteger)animationDuration:(NSInteger)size { CGRect startFrame = [ProgressBarMiddle frame]; [UIView beginAnimations:@"move10" context:NULL]; [UIView setAnimationDuration:animationDuration]; [ProgressBarMiddle setFrame:CGRectMake(startFrame.origin.x, 410, startFrame.size.width+size, startFrame.size.height)]; [ProgressBarRight setFrame:CGRectMake(33+(startFrame.size.width+size),410,10,20)]; [UIView setAnimationDelegate:self]; [UIView setAnimationCurve: UIViewAnimationCurveEaseOut]; [UIView commitAnimations]; splashtimer = [NSTimer scheduledTimerWithTimeInterval: animationDuration target: self selector: @selector(pushTabControl) userInfo: nil repeats: NO]; } -(void)pushTabControl { [self.navigationController pushViewController: tabObj animated:YES]; } -(void) startMoveProgress { LoadingBackground.frame = CGRectMake(22,410,276,22); UIImage *ProgressBarBackgroundImage = [UIImage imageNamed: @"loaderbg.png"]; [LoadingBackground setUserInteractionEnabled: YES]; LoadingBackground.image = ProgressBarBackgroundImage; [self ProgressBarSizeCheck:0:100]; } </code></pre> <p>//See Images</p> <p>1)loaderbg.png</p> <p><img src="https://i.stack.imgur.com/eAOlI.png" alt="loaderbg"></p> <p>2)loadercenterpart</p> <p><img src="https://i.stack.imgur.com/2xEp3.png" alt="centerpart"></p> <p>3)loaderrightpart <img src="https://i.stack.imgur.com/M0Js9.png" alt="rightpart"></p> <p>4) loderleftpart</p> <p><img src="https://i.stack.imgur.com/595dP.png" alt="enter image description here"></p>
    singulars
    1. This table or related slice is empty.
    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.
    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