April 29, 2014

Simulating button groups

This question popped up recently on the forum:

“Smart has a toolbar control and a toolbar button control, but no radio button control and no “down” property.  Is there any way to simulate this effect in the current version of Smart Mobile Studio?”

HTML buttons don’t have the down property but it can be simulated by changing the button’s CSS. The easiest way to do this is to create a new CSS class which is equal to the one used by the button but with the additional border:2px inset; declaration. Of course, you’ll also have to write a bit of code which will change the CSS during the execution.