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
Contributor
michaelrizzello
Posts: 19
Registered: ‎01-31-2013
My Device: Blackberry Curve 8900
Accepted Solution

q10 assets

Hey,

 

Is anyone aware of use the same QML layout for an app for the q10 but use images with different resolutions? I remember for the 6.0 and 7.0 the naming convention was different, any ideas on how to do it in bb10?

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: q10 assets

You can use a folder 720x720 in the assets folder. Not sure if you can only put images in there but just test it.

 

For instance:

assets

+- main.qml

+- images

   +- logo.png

+- 720x720

   +- images

     +- logo.png

 

______________________________________________________
BB10-OAuth: GitHub
Contributor
michaelrizzello
Posts: 19
Registered: ‎01-31-2013
My Device: Blackberry Curve 8900

Re: q10 assets

is there any documentation this? i was looking on the cascades website and i didn't find anything at all.

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: q10 assets

The only thing I found with a quick search :smileywink:.

 

https://developer.blackberry.com/cascades/documentation/ui/resolution/using_static_asset.html

______________________________________________________
BB10-OAuth: GitHub
Contributor
michaelrizzello
Posts: 19
Registered: ‎01-31-2013
My Device: Blackberry Curve 8900

Re: q10 assets

nope it doesnt seem to be working. looks like you have to create seperate qml for it.

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: q10 assets

I tried it and it works for me. The images is different on the Z10 and on the Q10. Make sure the same structure is followed and the images are named the same.

 

If your images are in the folder /assets/images make sure that the images for the Q10 are in the folder /assets/720x70/images. If they are in the /assets folder, then your images should be in the /assets/720x720 folder.

 

No need for separate qml files.

______________________________________________________
BB10-OAuth: GitHub
Contributor
michaelrizzello
Posts: 19
Registered: ‎01-31-2013
My Device: Blackberry Curve 8900

Re: q10 assets

did you use an absolute layout for your qml layout?

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: q10 assets

No, I use stacklayouts. I didn't test it with different resolution assets. I just tested with 2 different images of the same size. My Q10 simulator shows another image then my Z10 simulator show in my opinion, the Q10 should also load other resolution images.

 

Did you do an absolute positioning on your elements? Because this way, the image will always stay at the same place, regardless of the resolution.

______________________________________________________
BB10-OAuth: GitHub
Contributor
michaelrizzello
Posts: 19
Registered: ‎01-31-2013
My Device: Blackberry Curve 8900

Re: q10 assets

well I just did a test. I created the 720x720 directory and an images directory inside and I renamed the currently images directory to "1". When I went to run the app in the q10 simulator nothing loaded because it couldn't find the images. so here is my directory structure and I guess you can tell me if something is wrong.

 

-assets

--720x720

--- images

--images

 

 

Developer
Curahee
Posts: 229
Registered: ‎01-12-2013
My Device: z30

Re: q10 assets

And you are running the latest 10.1 SDK right? Because asset selection is only available from the 10.1... It's really weird because in my application he really does what you want. He picks the asset out of the 720x720 folder and shows it on the Q10 simulator. When the asset does not exists in the default folder, he just doesn't show it on the Z10 simulator.

 

Does he show it properly in the design mode of the qml? Because I can see if it's working right there. Don't have to run it to see it working or not...

______________________________________________________
BB10-OAuth: GitHub