【发布时间】:2023-02-14 16:05:15
【问题描述】:
我想尝试 garmin Watch Face 并很快遇到 folgenden 错误,但不幸的是我不知道为什么会这样,也许有人可以帮助你?
Cannot find symbol ':setText' on type 'PolyType<Null or $.Toybox.WatchUi.Drawable>'
我使用以下代码:
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);
}
}
为所有 .setText() 抛出错误。在这种情况下9次
我已经尝试了我能想到的一切。
【问题讨论】:
标签: javascript c++ garmin watchface monkeyc