Welcome!

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

Reply
Developer
AVPTI
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell
Accepted Solution

ImageButton

I am trying to make an Image button and when I set up the imageSource, it appears fine in the QML preview, but then doesn't load in my device.

 

I've tried JPG, PNG, GIF...nothing will work on device.

Please use plain text.
Developer
strobejb
Posts: 276
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: ImageButton

Does it work on the simulator?

What does your imageSource path look like?
Please use plain text.
Developer
AVPTI
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell

Re: ImageButton

Doesn't work on simulator 

 

Asset:///images/*pic name*

Please use plain text.
Developer
strobejb
Posts: 276
Registered: ‎10-15-2012
My Device: bb10 developer
My Carrier: Orange

Re: ImageButton

Unless that is a typo, it should be "asset:///images/"

The only other thing I can think of is that the images aren't being copied over onto the device/simulator. Are they in the location you think they are?

Try using:

Window -> Show View -> Target File System Navigator

Expand whatever target you are working with (sim/usb) and navigate to the Sandboxes directory - you'll find your app directory there. Check the app/native/assets directory to see if your images have been copied over

Please use plain text.
Developer
AVPTI
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell

Re: ImageButton

They all appear to be in the location you suggested 

Please use plain text.
Developer
AVPTI
Posts: 64
Registered: ‎06-28-2011
My Device: BlackBerry Z10
My Carrier: Bell

Re: ImageButton

For some reason started to work. I'm not sure if my device needed to reboot or my laptop, but it works now.

 

Thanks for your help.

Please use plain text.