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
Posts: 43
Registered: ‎07-23-2013
My Device: Z10
My Carrier: Vodacom

RSS/xml Web Service Images in List View

[ Edited ]

Hi All,

 

I've been wrecking my brain and just cannot get it right.

 

i have a list view as follows and the data source is for example http://www.buzzfeed.com/lol.xml , which is a RSS feed.

 

 I'm trying to get the <image> to be displayed as a thumbnail in the imageview below.. any ideas on how to do it please?

 

                listItemComponents: [
                    ListItemComponent {
                        type: "header"
                        Container {
                            Label {
                                text: ""
                            }
                        }
                    },
                    ListItemComponent {
                        type: "item"
                        Container {
                            Label {
                                id: title
                                text: ListItemData.title
                                textStyle.fontSize: FontSize.Large
                                multiline: true
                                textStyle.color: Color.DarkBlue
                            }
                            Label {
                                id: pubdate
                                text: ListItemData.pubDate
                                textStyle.fontSize: FontSize.XSmall
                            }
                            Label {
                                id: description
                                text: "<html><div>" + ListItemData.description + "</div></html>"
                                textStyle.fontSize: FontSize.Small
                                multiline: true
                            }
                            ImageView {
                                imageSource: ListItemData.image
                                scalingMethod: ScalingMethod.AspectFit
                                horizontalAlignment: HorizontalAlignment.Center
                                verticalAlignment: VerticalAlignment.Center
                                preferredHeight: 110
                                preferredWidth: 110
                                scaleX: 0.25
                                scaleY: 0.25
                            }
                            Divider {
                            }
                        }
                    }
                ]

 

Highlighted
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: RSS/xml Web Service Images in List View

You'll have to fetch the image - the ImageView component doesn't display remote images.

 

This thread covers some ways to do this: http://supportforums.blackberry.com/t5/Native-Development/Loading-image-from-URL/td-p/1717927

--
Rob is no longer associated with BlackBerry.