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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Cascades Development

Reply
Developer
nimithingu
Posts: 37
Registered: ‎09-04-2012
My Carrier: Vodafone Mumbai

Creating List Item in QML need help with opacity

[ Edited ]

HI I am trying to acheive some thing like the image below

 

sshot.png

 

But the text is also getting opaque if i change the opacity of the container in which the label is present please see the qml code below please help..

 

 

Container {
            maxHeight: 300
            maxWidth: 300
            topPadding: 10
            leftPadding: 10
            layout: DockLayout {
            }

            // The ImageView that shows the loaded image after loading has finished without error
            ImageView {
                preferredWidth: parent.maxWidth
                preferredHeight: parent.maxHeight
                imageSource: "asset:///images/face.png"
                verticalAlignment: VerticalAlignment.Fill
                horizontalAlignment: HorizontalAlignment.Fill
            }
            Container {
                preferredWidth: 300
                horizontalAlignment: HorizontalAlignment.Center
                verticalAlignment: VerticalAlignment.Bottom
                background: Color.Gray
                opacity: 0.5
                Label {
                    id: headlbl
                    text: "test sdjf sdjkhfb sdkjfh sdjkfh sdkfhj sds sdfs sdf"
                    multiline: true
                    textStyle.color: Color.White
                    textStyle.fontSize: FontSize.XSmall
                    textStyle.fontStyle: FontStyle.Normal
                    textStyle.fontWeight: FontWeight.Bold
                    opacity: 1.0
                }
            }
        }

 How to make the container opacity less by keeping the label's opacity as 1.0

 

 

 

Please use plain text.
Developer
Zmey
Posts: 921
Registered: ‎12-18-2012

Re: Creating List Item in QML need help with opacity

Put the label into another container with the same width and alignment, but without background color.
Please use plain text.
Developer
nimithingu
Posts: 37
Registered: ‎09-04-2012
My Carrier: Vodafone Mumbai

Re: Creating List Item in QML need help with opacity

Nope it did not work I tried this earlier also..
Please use plain text.
Contributor
xtravanta
Posts: 45
Registered: ‎03-25-2011
My Carrier: KPN

Re: Creating List Item in QML need help with opacity

I'm not sure what you are trying to do.. but do you want show a placeholder image or something ?
Please use plain text.
Developer
nimithingu
Posts: 37
Registered: ‎09-04-2012
My Carrier: Vodafone Mumbai

Re: Creating List Item in QML need help with opacity

[ Edited ]

If u will check the image in the above post is what I want to acheive .

Basically I want to do is change the opacity of the background of a container but not its childrens like in this case the label I refrain from using a transperant image as the text is dynamic and the height may increase or decrease so.

 

Hope I was clear enough..

Please use plain text.