Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Posts: 36
Registered: ‎04-19-2012
My Device: Z30, Z10, Q10, Playbook
My Carrier: Virgin

ImageView in 10.1 won't show image


I am trying to bring my app up to date using cascades 10.1 but somehow the code is now broken...when I use the below code in, it works perfectly and I have submitted my app for approval...I want to use some of the new features and eventually go to 10.2 but I am missing something...the picture exists as I have tried to bring in one specific image and it works fine....but going through filepicker, it does not bring the image into ImageView. I did also add the file:// in front to try that...I have tried on 2 different computers and still no luck. Thank you in advance.


Any help would be greatly appreciated. 


Container {

ImageButton {
id: button1
defaultImageSource: "asset:///menuicons/Button1.png"
pressedImageSource: "asset:///menuicons/Button2.png"
onClicked: picker1.open()

layoutProperties: AbsoluteLayoutProperties {

verticalAlignment: VerticalAlignment.Center
translationX: 90.0
ScrollView {
id: right1
scrollViewProperties.initialScalingMethod: ScalingMethod.AspectFill
scrollViewProperties.minContentScale: 0.25
scrollViewProperties.maxContentScale: 3
scrollViewProperties.pinchToZoomEnabled: true
scrollViewProperties.overScrollEffectMode: OverScrollEffectMode.OnScroll
scrollViewProperties.scrollMode: ScrollMode.Both
Container {
ImageView {
id: imgView1
objectName: "imgView1"
scalingMethod: ScalingMethod.AspectFill

clipContentToBounds: false
layout: DockLayout {
attachedObjects: [

FilePicker {
id: picker1
title: qsTr("Add Picture")
property string selectedFile
mode: FilePickerMode.Picker
type: FileType.Picture
directories: [ "file:///accounts/1000/shared/camera" ]
viewMode: FilePickerViewMode.GridView
sortBy: FilePickerSortFlag.Date
sortOrder: FilePickerSortOrder.Descending
//imageCropEnabled: true
onFileSelected: {
selectedFile = selectedFiles[0]
imgView1.imageSource = selectedFile
clipContentToBounds: false

Simplify your Life...