Reputation: 77
I have created some custom buttons and they don't animate like system buttons. I want them to animate like default system buttons. And the problem is when I change the button type from custom to system they loose the original image color to default blue color, and if I make them custom they maintain their original image color but stop animating. Screen shot is attached please have a look sample. Blue one has type system so it animates but loose its original color and green one is of custom type but it dont animate like system the blue one.
I want my button images in green color and animate like system button. Any clue how this can be done?
Upvotes: 0
Views: 523
Reputation: 1205
why not creating simple system button, but set it green tint color also to get this green effect you need set image render type(in the assets) "Render as Template image". I will add images below sou you can easily understand what I'm talking about.
This option is setting in attributes inspector in assets catalog for chosen image.
This options you can find in .storyboard file in "Attributes inspector" window for selected button.
Or by setting from code
button.setTintColor(UIColor.greenColor());
Upvotes: 1