While trying to find a cross platform based radiobutton solution that can be useful in BBcodeview, B4XRadioButton and ASRadioButton came to mind after finding out legacy radiobutton may pose challenge when i finally settle with B4I soon. Three b4xradiobuttons from designer were loaded into panel to work together as group in BBcodeview. It worked as group in bbcodeview, but i found it difficult to adjust height of varying text. I employed different tricks that were not successful like using -2 height wrap with reflection as in legacy radiobutton, but failed to work and not even cross platform compactible with b4J where it complained about missing method. I decided to access individual b4xradiobutton and its label from panel. All i could achieve is this in the picture below which worked only partially in B4J, but did not work at all in B4A. It worked partialy in B4J because all b4xradiobuttons become inactive (not responding to click again).
I also used MeasureTextHeight and MeasureTextWidth, 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.
What i like to achieve with this b4xradiobutton solution is like this image below irrespective of height of text.
Please, i will be happy if i can get a working sample for cross platform solution, below is my experimental code. In this experimental code, i work with B4J and B4A, but i will like it to work in B4I also to avoid too much headache when i finally pitch tent with B4I soon.
Thanks
I also used MeasureTextHeight and MeasureTextWidth, 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.
What i like to achieve with this b4xradiobutton solution is like this image below irrespective of height of text.
Please, i will be happy if i can get a working sample for cross platform solution, below is my experimental code. In this experimental code, i work with B4J and B4A, but i will like it to work in B4I also to avoid too much headache when i finally pitch tent with B4I soon.
Thanks
Attachments
Last edited: