Hello all, may I ask for help please?
in layout.xml I have defined background bitmap and text labels for time and everything draws fine. However, when I draw rectange in actual onLayout(dc) function, it does not show. The function is here, taken from examples:
function onUpdate(dc) {
// Get and show the current time
var clockTime = System.getClockTime();
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]);
var view = View.findDrawableById("TimeLabel");
view.setText(timeString);
dc.setColor(Graphics.COLOR_BLUE, Graphics.COLOR_RED);
dc.fillRectangle(100, 100, 100, 100);
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}
on the other hand, when I comment out View.onUpdate(dc); then the rectangle is drawn, but no background, no texts. How can I please draw both oblects from layout.xml and those defined in the function onUpdate(dc)?
Thanks very much, Jan