askingPPl
askingPPl

Reputation: 263

Button font in difference color

I trying to change button style become below image. In the end, I just used gridlayout to show design I want. Isn't possible using button show out the same design below image?

enter image description here

<GridLayout rows="auto" columns="auto, auto" backgroundColor="#ffffff" padding="10" borderWidth="0.2" borderColor ="#E7E7E7" tap="onClick" id="btnTG" matchId="{{ SLMatchId }}" dataType="odd_0" tap="onBtnClick">
      <label text="{{ 0 + ' '}}" color="red" fontWeight = "bold" id="lblTG1"/>
      <label text="{{ OddsList.TG0 }}"  col="1" id="lblTG2"/>
 </GridLayout> 

I find out formattedText properties can apply in. But after I try it and find out Button component font cannot change color. Isn't anything coding wrong?

    <Button col="3" backgroundColor="#ffffff" paddingTop="10" borderWidth="0.2" borderColor ="#E7E7E7" paddingBottom="10" matchId="{{ SLMatchId }}" paddingLeft="7" id="btnTG" dataType="odd_UP7" tap="onBtnClick">
            <Button.formattedText>
                  <FormattedString>                                                           
          <FormattedString.spans>
              <Span text="{{ 0 + ' '}}" foregroundColor="#D93F3F"  />
              <Span text="{{ 13.00 }}"  />   
          </FormattedString.spans>
       </FormattedString>
   </Button.formattedText>            

Upvotes: 0

Views: 153

Answers (1)

It worked for me:

<Button>
    <FormattedString>
        <Span
            text="'0 '"
            fontAttributes="Bold"></Span>
        <Span
            text=" 13.00"></Span>
    </FormattedString>
</Button>

Upvotes: 1

Related Questions