【发布时间】:2021-06-14 17:51:21
【问题描述】:
我正在使用qt,我的导航项需要从设备设置自定义图像,如何在NavigationItem上设置图像?
App {
Navigation {
NavigationItem {
title: "Main"
//I need set Image on this item, kindly help me. I know there is icon, but I dont know how to set custom image.
//Image{ " icon.source: "https://www.howtogeek.com/wp-content/uploads/2018/06/shutterstock_1006988770.png""
// anchors.left:parent.left
}
}
}
【问题讨论】:
-
导航不是 QML 标准的一部分,您使用的是 Felgo 之类的库吗?
-
是的。我正在使用的费尔戈
-
你试过了吗:
icon.source: "file:///C:/Users/Nourin/Pictures/cnt.png"? -
我收到错误“file:WebEditor/qml/WebScriptMain.qml:8: Invalid grouped property access”
-
现在我已经从 http 获取了 url 源。仍然错误是一样的。