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
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind
Accepted Solution

Change textSize of label from customControl

Hey All, trying to change the textsize of a label in a custom control. Typically I just use a property alias to define the property from the customControl that I want to change but in this case the alias textSize: label.textStyle.size is clearly not going to work, is there any way to accomplish this? Thanks.

Please use plain text.
Regular Contributor
coolneo
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user
My Carrier: Airtel

Re: Change textSize of label from customControl

can you give a code snippet to show how you are trying to do this.

Please use plain text.
Developer
blackqtcoder
Posts: 145
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C
My Carrier: Telefonica Spain

Re: Change textSize of label from customControl

Have you tried this ? :

 

----------------------------

 

        property alias textSize: tsd.size

 

        Label {
           
            textStyle
            {
                base: tsd.style
            }            
            attachedObjects: [
                TextStyleDefinition
                {
                     id: tsd
                     base: SystemDefaults.TextStyles.BodyText
                     fontWeight: FontWeight.Bold
                 }
            ]           
        } //Label

 

----------------------

 

Hope this works for you !

---------------------------------------------------------------
Leandro Cerdan - Duantox Apps
BlackBerry Elite dev
TapyHold, Built for Blackberry multimedia scrapbook
Please use plain text.
Developer
vingilot
Posts: 224
Registered: ‎03-29-2012
My Device: 9900
My Carrier: Wind

Re: Change textSize of label from customControl

worked like a charm! I'll look into attachedobjects more that was very helpful thanks.

Please use plain text.