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
Highlighted
Developer
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile
Accepted Solution

imageview or webview

i want to input an image into a listview. the image is from an url. should i use imageview or webview component.

who can tell me the difference

 

thx

Developer
Posts: 508
Registered: ‎01-19-2011
My Device: My Trusty Red Plane
My Carrier: Outer Space

Re: imageview or webview

you should use an imageview.

per default, StandardListitem already has an image component, see here

https://developer.blackberry.com/native/reference/cascades/bb__cascades__standardlistitem.html#prope...

 

just set the imagesource and you are good to go

 

Since you just want to display an image, using a WebView would be too much overhead. Inside a webview, you can have complete htmls, e.g. buttons, links etc

-----------------------------------------------------------------------
I'm a bird from outer space. But I'm not flappy o.o
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: imageview or webview

Just to add to @pyth's answer since it's from the web you should use asynchonous loading...

 

Some resources to help...

 

http://developer.blackberry.com/native/documentation/cascades/ui/lists/asynch_data.html

 

http://blackberry.github.io/Cascades-Samples/imageloader.html


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Retired
Posts: 83
Registered: ‎10-10-2012
My Device: Z30
My Carrier: Bell

Re: imageview or webview

elemtype,

 

Can you either 'accept' the solutions provided - if they resolve your issue - or let us know if the posted solutions did not resolve your problem.

 

thanks,

g

Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: imageview or webview

@garydev LOL he hasn't been on for 8 hours he might not have even read the responses yet, give him a little time to read and investigate. Smiley Happy


If you've been helped click on Like Button, if you've been saved buy the app. Smiley Happy

Developer of stokLocker, Sympatico and Super Sentences.
Developer
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile

Re: imageview or webview

you're right.
it's right to use imageview here.WebView would be too much overhead.
Developer
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile

Re: imageview or webview

thinks for your help.it's very useful.

i also got some idea from https://github.com/RileyGB/BlackBerry10-Samples/tree/master/WebImageViewSample
Developer
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile

Re: imageview or webview

you know it's night here..

thanks for your advice.
Developer
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile

Re: imageview or webview

it's night here ,hehe...