alloy.widget.iconicfont
alloy.widget.iconicfont copied to clipboard
addEventListener doesn't work.
<Widget class="icon" id="test" icon="icon-facebook" src="be.k0suke.fontawesome" />
$.test.addEventListener('click',function(){alert('test');});
However, the fireEvent
works just fine
$.test.fireEvent('test');
Secondary issue is that you can't use the selectedColor
property (so you can get an icon to sort of act like a button.
Third issue is that inserting the widget inside a button like
<Button>
<Widget />
</Button>
creates a top padding above the widget.
1, Try this code.
<Widget class="icon" id="test" icon="icon-facebook" src="be.k0suke.fontawesome" />
$.test.getView().addEventListener('click',function(){alert('test');});
$.test.getView().fireEvent('test');
2 and 3, This widget is Ti.UI.Label
. So if you want to use the title of the Ti.UI.Button
, then use the library here. This library to return the character code of icon.