问题
I'm looking out for some solution regarding the custom progress view.
Basically, i would like to fill the image below to represent the loading progress,just like the one's we have in games.

Any ideas how to achieve it??
回答1:
Masking using CoreGraphics:
UIImage *img = [UIImage imageNamed:@"imagetomask.png"];
CGImageRef maskRef = [UIImage imageNamed:@"mask.png"].CGImage;
CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef),
CGImageGetHeight(maskRef),
CGImageGetBitsPerComponent(maskRef),
CGImageGetBitsPerPixel(maskRef),
CGImageGetBytesPerRow(maskRef),
CGImageGetDataProvider(maskRef), NULL, false);
CGImageRef maskedImage = CGImageCreateWithMask([img CGImage], mask);
[imageView setImage:maskedImage];
Your mask.png
should be non-transparent image filled like inverted alpha - black for visible parts, white for transparent.
回答2:
Create custom view class and add animation sequence in that class to show your images in sequence infinitly.
Add that view to mainwindow like this (UIWindow*)[[UIApplication sharedApplication].windows objectAtIndex:0];
call bringSubviewToFront to show that view on any view where u want this loading screen(view).
来源:https://stackoverflow.com/questions/9140030/custom-shaped-progress-view