I'm developing an app for my VivoActive 4 which currently has a Button containing a bitmap, which is added via onLayout(dc) so I can set/handle a `behavior`...
var myBtn = null;
function onLayout(dc) {
var elements = [];
var myBitmap = new WatchUi.Bitmap({:rezId=>Rez.Drawables.MyIcon});
myBtn = new WatchUi.Button({
:locX=>50,
:locY=>50,
:width=>50,
:height=>50,
:stateDefault=>myBitmap,
:stateHighlighted=>myBitmap,
:behavior=>:onBtnClicked
});
elements.add(myBtn);
setLayout(elements);
}
Is it possible to hide/remove the button and/or image after the onLayout has run?
I've tried accessing either the button or the image within `onUpdate(dc)` but I simply cannot figure out a way to get it to disappear in response to an action.
Can somebody please point me in the right direction.
Cheers,
Tom