When I use canvas in B4XPage_Resize, the texts of the radio buttons are duplicated
B4X:
'You can see the list of page related events in the B4XPagesManager object. The event name is B4XPage.
Private Sub B4XPage_Resize (Width As Float, Height As Float)
Log("B4XPage_Resize")
#if B4i
Dim r As Rect = B4XPages.GetNativeParent(Me).SafeAreaInsets
Root.SetLayoutAnimated(0, r.Left, r.Top, Width - r.Right - r.Left, Height - r.Bottom - r.Top)
#end if
Resize1(B4XRadioButton1)
Resize2(B4XRadioButton2)
CanvasEncabezado(Label1)
End Sub
Sub Resize1(xrbt As B4XRadioButton)
Dim Height As Int = 30dip
xrbt.mBase.GetView(1).Height = Height
xrbt.mBase.GetView(1).Width = xrbt.mBase.GetView(0).Height
xrbt.mBase.GetView(1).top = (Height - xrbt.mBase.GetView(0).Height) / 2
End Sub
Sub Resize2(xrbt As B4XRadioButton)
Dim Height As Int = 40dip
xrbt.mBase.GetView(2).Height = Height
xrbt.mBase.GetView(2).Width = xrbt.mBase.GetView(0).Height
xrbt.mBase.GetView(2).top = (Height - xrbt.mBase.GetView(0).Height) / 2
End Sub
Sub CanvasEncabezado(lbl As B4XView)
Dim cvsLinea As B4XCanvas
Dim x1, x2, y1, y2 As Int
Dim ColorLinea As Int = lbl.TextColor
cvsLinea.Initialize(lbl.Parent)
Dim r As B4XRect = cvsLinea.MeasureText(lbl.Text, lbl.Font)
x1 = lbl.Left + r.Width + 16dip
x2 = lbl.Top + lbl.Height / 2
y1 = 100%x
y2 = lbl.Top + lbl.Height / 2
cvsLinea.DrawLine(x1, x2, y1, y2, ColorLinea, 1dip)
cvsLinea.Invalidate
cvsLinea.Release
End Sub