I’d like to create a simple, custom loading bar that consists of two images I have: one image for the solid colored background and one image for the diagonals. I’m new to iOS, so my approach is going to be to create a custom UIView that uses two UIImageViews, one for each image, with an animation block to move the diagonals image from left to right.
I’m taking this approach because I’m already familiar with UIImageViews and animation blocks. My questions are…
- Would you suggest a better approach? I’m not at all familiar with layers and, due to time constraints, would prefer not to have to read up on them now, but I’m willing to if it will provide a vastly better implementation.
- How can I “round” the ends of the loading bar? With my current approach, this is what I’m going to get…

Thanks so much for your wisdom!
Have your ‘solid colored background’ view be a container view for the ‘diagonals’ imageView.
(diagonals is a subview of background)
Then set ‘clipsToBounds’ = YES on the diagonals subview and re-adjust the frame as necessary. (Assuming your diagonals imageView represents 100% progress)
If your loading bar imageView doesn’t have rounded corners you can just use CALayer’s cornerRadius property.