If you are using Internet Explorer, please remove blackberry.com from your compatibility view settings.

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
elemtype
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

Please use plain text.
Developer
pyth
Posts: 485
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
Please use plain text.
Developer
BBSJdev
Posts: 6,024
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
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. :smileyhappy:

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
BlackBerry Development Advisor (Retired)
garydev
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

Please use plain text.
Developer
BBSJdev
Posts: 6,024
Registered: ‎07-05-2012
My Device: Playbook, Z10 LE, Dev Alpha C
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. :smileyhappy:


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

Developer of stokLocker, Sympatico and Super Sentences.
Please use plain text.
Developer
elemtype
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.
Please use plain text.
Developer
elemtype
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
Please use plain text.
Developer
elemtype
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.
Please use plain text.
Developer
elemtype
Posts: 15
Registered: ‎02-20-2014
My Device: Z10
My Carrier: china mobile

Re: imageview or webview

it's night here ,hehe...
Please use plain text.