cancel
Showing results for 
Search instead for 
Did you mean: 

Button with svg image?

Roger.ch
Associate III

Hello everyone

Can I also add an svg image to a button? I can embed images in svg format (almost) without any problems. However, if I want to assign an image to a flex button, only png works. Is there a workaround for this or does it just not work?

Regards, Roger

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Roger.ch ,

Unfortunately, SVGs are not supported on buttons yet. You can only use SVG as standalones.

However, you can use an 'SVG Image' and then enable ClickListener option for it under the Mixins section. This way you can have the click functionality of a button, and you can manually (I mean from the code) set different SVGs for different click events (but it might be a bit tricky to handle perfectly) to imitate Released or Clicked states.

Good luck

Mohammad MORADI
ST Software Developer | TouchGFX

View solution in original post

1 REPLY 1

Hello @Roger.ch ,

Unfortunately, SVGs are not supported on buttons yet. You can only use SVG as standalones.

However, you can use an 'SVG Image' and then enable ClickListener option for it under the Mixins section. This way you can have the click functionality of a button, and you can manually (I mean from the code) set different SVGs for different click events (but it might be a bit tricky to handle perfectly) to imitate Released or Clicked states.

Good luck

Mohammad MORADI
ST Software Developer | TouchGFX