Android Question B4XDialog - LongTextTemplate change font

Alessandro71

Active Member
Licensed User
I've tried the usual searching with no luck.
I'm trying to use a different font for a LongTextTemplate B4XDialog with no luck.
I already tried setting the base panel font, but probably not in the correct way, since I get an Exception
 

Mahares

Well Known Member
Licensed User
I'm trying to use a different font for a LongTextTemplate B4XDialog with no luck.
You can use CSBuilder like this:
B4X:
LongTextTemplate.Text = $"Lorem ipsum dolor sit amet,
consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Enim blandit volutpat maecenas volutpat blandit aliquam. In egestas erat imperdiet sed euismod nisi porta.
Arcu ac tortor dignissim convallis aenean et tortor. Elit pellentesque habitant morbi tristique senectus et netus et malesuada.
Ut tristique et egestas quis ipsum suspendisse ultrices. Mauris a diam maecenas sed enim ut sem viverra.
Mauris rhoncus aenean vel elit scelerisque. Volutpat consequat mauris nunc congue nisi vitae suscipit.
Tempor orci eu lobortis elementum nibh tellus molestie. Eleifend quam adipiscing vitae proin sagittis nisl rhoncus.
Faucibus turpis in eu mi bibendum neque egestas congue quisque. Vel eros donec ac odio tempor orci dapibus ultrices in.
Velit egestas dui id ornare arcu. Eget nunc lobortis mattis aliquam faucibus purus in massa. Arcu non sodales neque sodales.
Elementum nisi quis eleifend quam. Elementum nisi quis eleifend quam."$
Dim cs As CSBuilder
cs.Initialize.Color(XUI.Color_Blue).Typeface(Typeface.DEFAULT_BOLD).Size(30).Append(LongTextTemplate.text).PopAll
LongTextTemplate.Text =cs
LongTextTemplate.CustomListView1.DefaultTextBackgroundColor = XUI.Color_Yellow
LongTextTemplate.Resize(Activity.Width,Activity.Height/2)
 
Top