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

Regular Contributor
coolneo
Posts: 56
Registered: ‎06-25-2012
My Device: non-blackberry user

Re: Change textSize of label from customControl

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

Developer
blackqtcoder
Posts: 146
Registered: ‎05-18-2012
My Device: PlayBook & STL100-1 LE Z10 & Dev Alpha C

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

Re: Change textSize of label from customControl

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