Hi,
I draw a retangle and in the retangle a Text. I convert the panel to a view to change the border color and radius.
Why? I want rounded corners and I need to change the border color when I click on the panel.
This works fine in b4i, but in b4a the text from cvs.DrawText is gone.
What can I do that it works like in b4i ?
I draw a retangle and in the retangle a Text. I convert the panel to a view to change the border color and radius.
Why? I want rounded corners and I need to change the border color when I click on the panel.
This works fine in b4i, but in b4a the text from cvs.DrawText is gone.
What can I do that it works like in b4i ?
B4X:
Dim cvs As B4XCanvas
Dim p As Panel
p.Initialize("test")
p.Width=50
p.Height=50
Dim color As Int = xui.color_red
cvs.Initialize(p)
cvs.Resize(p.Width, p.Height)
Dim rect As B4XRect
rect.Initialize(0, 0, 50, 50)
cvs.DrawRect(rect,color, True, 1dip)
Dim fontsize As Int =14
cvs.DrawText("Test",p.Width/2,(p.Height/2)+(fontsize/2),xu.CreateDefaultFont(fontsize),xui.Color_Black,"CENTER")
'In b4a my drawtext is gone after setcolorandborder, in b4i it works fine
Dim view As B4XView
view = p
view.SetColorAndBorder(color,1dip,color,5)