0
訪問嵌套容器的性能我想要訪問imageContainer的屬性ListItemComponent範圍之外,例如,當取向的變化,我曾嘗試以下:如何使用ID
imageContainer.imageHeight
它返回一個未定義的在日誌。
代碼的部分去如下:
ListItemComponent {
type: "item"
Container {
id: listContainer
layout: DockLayout {
}
preferredWidth: 180
preferredHeight: 180
ActivityIndicator {
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
id: myIndicator
preferredWidth: 70
}
Container {
id: webimageContainer
verticalAlignment: VerticalAlignment.Center
horizontalAlignment: HorizontalAlignment.Center
preferredWidth: 200
preferredHeight: 200
ImageDownloader {
id: imageContainer
imageWidth: 170
imageHeight: 170
imageUrl: ListItemData.thumbnailPath
onCloudImageUnavailable: {
imageUrl = "asset:///images/ic_view_image.png";
}
}
}
onCreationCompleted: {
if (parent.parent.dv_width == 720) {
listContainer.preferredWidth = 160;
listContainer.preferredHeight = 160;
}
}
}
}
預先感謝。
? – 2014-09-22 23:11:25
@rontornambe 它是在ImageDownloader中定義的 id:imageContainer – 2014-09-22 23:12:57
我對Containers不太瞭解,但是你能從ListItemComnponent中引用imageContainer嗎? – 2014-09-22 23:18:07