I started this BUG report on the assumption that it was the SetLayoutAnimated method that was the culprit of the removing of the Text Format, But after a small test, I discovered that a simple textsize change does it.
How to replicate:
In the visual designer, add a Label and set a few format Options, like Bold,Italic and size.
save the layout, and in the code, change the textsize property to a different value than the one you set in the visual designer... you'll find that that action has removed all the other formatting.
PS: I found that using the extra css property and set it to -fx-font-weight:bold; results in a bold text even after text resizing by code.
So I guess that tsyle appends/overrides the base styling, while textsize removes any non css style set propertiies
How to replicate:
In the visual designer, add a Label and set a few format Options, like Bold,Italic and size.
save the layout, and in the code, change the textsize property to a different value than the one you set in the visual designer... you'll find that that action has removed all the other formatting.
PS: I found that using the extra css property and set it to -fx-font-weight:bold; results in a bold text even after text resizing by code.
So I guess that tsyle appends/overrides the base styling, while textsize removes any non css style set propertiies
I used the following to "clone" a view (not rally cloning it but to be able to reference it)
I found that, even thou Label1 has font properties set to be Font Size =14 and BOLD ITALIC in style, these are not cloned into the targetLabel
B4X:
Dim Target as ImageView = Sender
Dim targetLabel As Label
MySelection = target.Tag
Select MySelection
Case "xpto"
targetLabel = Label1
Case ..."
End Select
y=target.Top
yl=targetLabel.Top - 5
target.SetLayoutAnimated(300,x,y,80,80)
targetLabel.SetLayoutAnimated(300,xl,yl,55,30)
targetLabel.TextSize = 14
I found that, even thou Label1 has font properties set to be Font Size =14 and BOLD ITALIC in style, these are not cloned into the targetLabel
Last edited: