我想尝试 garmin WachFace,但很快就遇到了folgnden 错误,但不幸的是我不知道为什么会发生这种情况,也许有人可以帮助你?
Cannot find symbol ':setText' on type 'PolyType<Null or $.Toybox.WatchUi.Drawable>'
Run Code Online (Sandbox Code Playgroud)
我使用以下代码:
function onUpdate(dc as Dc) as Void {
setClockDisplay();
setDateDisplay();
setBatteryDisplay();
setStepCountDisplay();
setStepGoalDisplay();
setNotificationCountDisplay();
setHeartrateDisplay();
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}
private function setClockDisplay() {
var clockTime = System.getClockTime();
var timeString = Lang.format("$1$:$2$", [clockTime.hour, clockTime.min.format("%02d")]);
var view = View.findDrawableById("TimeLabel");
view.setText(timeString);
}
}
Run Code Online (Sandbox Code Playgroud)
所有 .setText() 都会引发错误。在这种情况下9次
我已经尝试了我能想到的一切。