I am using this widget to display SVGs in my Titanium Alloy app:
https://github.com/appcelerator-services/VectorImage
The SVGs display just fine, but the onClick event does not fire when I tap on the SVG on iOS. Onclick does work on Android. I have tried applying the onClick to the widget itself as well as applying it to the containing element. I am able to click on the containing element, but not on the SVG.
<View class="dashboardGridCell" onClick="goToPayBill">
<View class="dashboardIcon">
<Widget class="dashboardIconSvg" src="com.capnajax.vectorimage" svg="svg/circle-check.svg" style="svg/white-fill.css" onClick="goToPayBill"/>
</View>
<Label class="dashboardIconLabel">Pay Bill</Label>
</View>
Is there a better widget for displaying SVGs or is there something I am doing wrong with applying the onclick?
Widget's do not support the onClick handler in the XML because they are not standard Titanium Proxy objects, they can be whatever their creator defines. Plus right now, even if an onClick property is specified, we don't evaluate the onClick parameter your passing in as a function.
To set a click event on the widget you'll need to do this in javaScript (so you'll want to give it an id)
In your XML change it to something like this:
Then in your javaScript you should be able to do this (based on what i can tell looking at the widgets source code).
Hope this helps!