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: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

BarcodeView in a Container

I'm using the BarcodeView and it works when the base element in a in Page but doesn't work in a Container.

 

Has anyone experienced this?

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Developer
Posts: 6,152
Registered: ‎07-05-2012
My Device: Playbook, Dev Alpha C, Z10 LE, Z30
My Carrier: Orange

Re: BarcodeView in a Container

Can you post your code?

 

Does it make any difference if you set width and height fairly large?

 


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: 676
Registered: ‎05-06-2012
My Device: Dev Alpha & PlayBook
My Carrier: wifi

Re: BarcodeView in a Container

[ Edited ]

Page {

Container {

        preferredHeight: 500

        preferredWidth: 500

        BarcodeView {

            data: number

            format: "Pdf417"

        }     

    }

}

_________________________________________________________
co-founder of Diaree | BB Dev for PictureThis
Highlighted
Retired
Posts: 252
Registered: ‎08-17-2012
My Device: BlackBerry Z10 and Q10
My Carrier: Bell

Re: BarcodeView in a Container

Hi Philipk, are you having the correct include statements? I have tested the following code and it works as expected:

 

import bb.cascades 1.2
import bb.cascades.multimedia 1.2

Page{
    Container {
        
        BarcodeView {
            id: barcodeView
            data: "Life is good."
            visible: true
            preferredHeight: 400
            preferredWidth: 400
            
            verticalAlignment: VerticalAlignment.Center
            horizontalAlignment: HorizontalAlignment.Center
        }
        onCreationCompleted: {
            console.log(barcodeView.data)
        }
    }
}

 

@SamarAbdelsayed

Did this answer your question? Please accept post as solution.
Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker