簡(jiǎn)單大氣網(wǎng)站欣賞數(shù)據(jù)推廣公司
1、HarmonyOS 屬性變量常量是否可以作為object對(duì)象的key?
a: object = new Object() this.a[Constants.TEST_KEY] = "456"
可以先定義,再賦值
2、首頁(yè)點(diǎn)擊回到waterflow的首節(jié)點(diǎn),0~index全部節(jié)點(diǎn)被重建,導(dǎo)致卡頓
使用scrollTo會(huì)重新計(jì)算布局觸發(fā)節(jié)點(diǎn)重建。使用scrollToIndex可解決此問(wèn)題。
3、HarmonyOS 新版本打包后無(wú)法上傳,一直顯示解析中,然后解析失敗?
出現(xiàn)此錯(cuò)誤,原因是元服務(wù)API調(diào)用檢測(cè)失敗。使用API11及以上開發(fā)的元服務(wù),只能調(diào)用“元服務(wù)API集”內(nèi)的API。參考:https://developer.huawei.com/consumer/cn/doc/app/agc-help-harmonyoserror-0000001651912985#section182629567266
請(qǐng)檢查 的元服務(wù)包內(nèi)是否調(diào)用了“元服務(wù)API集”以外的API,修改后重新打包上傳。元服務(wù)API:https://developer.huawei.com/consumer/cn/doc/atomic-references-V5/atomic-apis-intro-V5
4、HarmonyOS har的resource目錄下放視頻,工程中引入har之后,無(wú)法通過(guò)video控件播放視頻?
通過(guò)getContext().resourceManager.getRawFileContentSync獲取har中的資源后,發(fā)現(xiàn)Video控件不支持通過(guò)字節(jié)流設(shè)置資源,導(dǎo)致Video控件無(wú)法播放har中的視頻
參考:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/ts-media-components-video-V5
目前不支持字節(jié)流的播放,請(qǐng)直接傳入resource
推薦將har內(nèi)的資源以resource的返回值形式作為接口返回值暴露
5、HarmonyOS 有沒(méi)有類似與Vue中this.$nextTick的方法?
有沒(méi)有類似與Vue中this.$nextTick的方法
this.getUIContext().getUIInspector().createComponentObserver("Page13HelloWorld").on("draw", () => {console.log("testTag - draw")let utils = this.getUIContext().getComponentUtils()let com = utils.getRectangleById("Page13HelloWorld")console.log("testTag - draw - height : "+ com.size.height );
該接口能監(jiān)聽組件刷新