Dim xpnl_RadioButton As B4XView = xui.CreatePanel("")
xpnl_RadioButton.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
Dim m_Properties As Map
m_Properties.Initialize
m_Properties.Put("Value",False)
m_Properties.Put("OnColor",0xFF00D254)
m_Properties.Put("OffColor",0xFFCACACA)
m_Properties.Put("HapticFeedback",True)
Dim lbl As Label
lbl.Initialize("")
Dim rb1 As B4XRadioButton
rb1.Initialize(Me,"rb1")
rb1.DesignerCreateView(xpnl_RadioButton,lbl,m_Properties)
Dim xpnl_RadioButton As B4XView = xui.CreatePanel("")
xpnl_RadioButton.SetLayoutAnimated(0, 0, 0, 300dip, 300dip)
Dim m_Properties As Map
m_Properties.Initialize
m_Properties.Put("Value",False)
m_Properties.Put("OnColor",0xFF00D254)
m_Properties.Put("OffColor",0xFFCACACA)
m_Properties.Put("HapticFeedback",True)
Dim lbl As Label
lbl.Initialize("")
Dim rb1 As B4XRadioButton
rb1.Initialize(Me,"rb1")
rb1.DesignerCreateView(xpnl_RadioButton,lbl,m_Properties)
As soon as the view gets more designer properties and the developer doesn't add any GetDefault values, the whole thing doesn't work anymore if you don't maintain it manually. Per designer is the simpler variant, but there you must also open and close the layout file for new properties, if the developer has not added GetDefault values for the new properties.