Reputation: 1
I need to create effect of filling a UIView
with color, with animation.
For example as a battery image is filled with background color .
So i can see the problem as 2 :
How would you color part of a UIView
natively? (obj-C)
UIView *view=[UIView alloc] init];
view.backgroundColor=[UIColor redColor]; //is colouring all of it .
creating 2 views is a problem,because i need to animate the whole thing as it fills the color .
Upvotes: 0
Views: 790
Reputation: 4331
You would use two views, which is not a problem if you just put the second view as a subview into the first. This way you can just animate outer view and the inner will follow.
To show you battery level you would just animate the frame of the inner view.
Upvotes: 1