Private Sub B4XPage_Created (Root1 As B4XView)
Root = Root1
Root.LoadLayout("MainPage")
TextEngine.Initialize(Root)
BBCodeView1.Text = $"
${CreateRB} I also used MeasureTextHeight but found it difficult to integrate in BBcodeview environment since all B4XRadiobuttons and label i like to work with are inside panel and if individual B4Xradiobutton is
accessed with pnl.Getview(0) or B4xRadioButton1.mBase.GetView(0) or similar, it loses its group attribute and even inactive as shown above.
${CreateRB} What i like to achieve with this b4xradiobutton solution is like this image below irrespective of height of text.
${CreateRB} akqfew kjlqjf lqkwfj lkqw fjklqw jflqkjwf
qkwjflqklwf jqlkwj flqkw jflkq jflqkw jfqlkw f
"$
End Sub
Private Sub CreateRB As String
Dim pnl As B4XView = xui.CreatePanel("")
pnl.SetLayoutAnimated(0, 0, 0, 40dip, 40dip)
pnl.LoadLayout("RadioButton")
Dim name As String = ("rb" & BBCodeView1.Views.Size)
Dim rb As B4XRadioButton = pnl.GetView(0).Tag
rb.mBase.RemoveViewFromParent
rb.mBase.SetLayoutAnimated(0, 0, 0, 40dip, 40dip)
BBCodeView1.Views.Put(name, rb.mBase)
Return $"[View=${name} Vertical=10/]"$
End Sub
Private Sub B4XRadioButton1_Checked
For Each v As B4XView In BBCodeView1.Views.Values
If v.Tag Is B4XRadioButton And v.Tag <> Sender Then
v.Tag.As(B4XRadioButton).Checked = False
End If
Next
End Sub