Android Question CsBuilder FontSize

ykucuk

Well-Known Member
Licensed User
Longtime User
B4X:
cs.Initialize.Font(Font.CreateNew(45)).Append("Some Text").Pop

I am using CsBuilder to create text, and while I can change properties such as color, alignment, and font, I cannot adjust the font size. I took sample code from Erel's examples, but the situation remains the same. Interestingly, it works fine if I select the label in the designer and change the text size there. What am I doing wrong?
 

toby

Well-Known Member
Licensed User
Longtime User
You can use relativeSize() as follows
increase size by 50%:
cs.Initialize.Font(Font.CreateNew(45)).RelativeSize(1.5).Append("Some Text").PopAll
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
or Size()
B4X:
cs.Initialize.Size(18).Append("Some Text").PopAll '18 is actual size not dip units'
 
Upvote 0

toby

Well-Known Member
Licensed User
Longtime User
Which version of B4a are you using? It works for me as shown below.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…