hyperoslo / ImagePicker

:camera: Reinventing the way ImagePicker works.
Other
4.87k stars 677 forks source link

How do we change "Done" and "Cancel" button to an image? #361

Closed tomasbykowski closed 4 years ago

tomasbykowski commented 6 years ago

I've tried everything, can't figure out how to change the Done and Cancel button so that it shows an image. Would really appreciate help with this, thank you!

tomasbykowski commented 6 years ago

ping

onmyway133 commented 6 years ago

@tomasbykowski Hi, right now they are UIButton with text on it https://github.com/hyperoslo/ImagePicker/blob/master/Source/BottomView/BottomContainerView.swift#L38. But they are not exposed for customising yet, so for now, you might wait after view has laid out, then traverse view hierarchy to alter them. Or you can make a PR to mark them as public

tomasbykowski commented 6 years ago

@onmyway133 Hey, thank you for the reply!

I was able to add an image by adding button.setImage("image", forState: .Normal) to the code that you linked. Though i can't figure out how to assign different images for the "cancel" and "done" button, so that the image changes between states.

Seems like an easy fix but i can't figure it out!