pmusolino / PMAlertController

PMAlertController is a great and customizable alert that can substitute UIAlertController
MIT License
2.53k stars 186 forks source link

Custom buttons #63

Closed ogezue closed 6 years ago

ogezue commented 6 years ago

Is it possible to add custom buttons like this?

button
pmusolino commented 6 years ago

Yes, you can customize the button to appear like this.

-Paolo

JawaharChirimar commented 6 years ago

How do you do it? Would appreciate it if you can point me in the right direction?

silnose commented 5 years ago

How do you do it? Would appreciate it if you can point me in the right direction?

Help with the same! haha

silnose commented 5 years ago

I try with a image of the button and this configuration

        okAction.setImage(image, for: .normal)
        okAction.imageEdgeInsets = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: -50)
        okAction.titleEdgeInsets = UIEdgeInsets(top: 0, left: -200, bottom: 0, right: 0)

Screen Shot 2019-07-03 at 00 43 27

I don't know if is the best approach but i try to set the image as background and i can't make look right, it's getting to big and very stretched

okAction.setBackgroundImage(image, for: .normal)

image

And I tried with gradient too but nothing happend , only the textButton display :(

I really appreciate some help here!. Thk in advance ;)