Android Question How to hide RadioButton Circle?

mr.gedo

Member
Hello, I'm using this code to set the image to the radio button

https://www.b4x.com/android/forum/t...heckboxes-and-radio-buttons.32528/post-189651

B4X:
Sub Activity_Create(FirstTime As Boolean)
    Activity.LoadLayout("main")

    AddStatelistRadioButton(rbtTest1, "Flag_GB_1.png", "Flag_GB_2.png", "Flag_GB_3.png", Gravity.CENTER)
    AddStatelistRadioButton(rbtTest2, "Flag_F_1.png", "Flag_F_2.png", "Flag_F_3.png", Gravity.CENTER)
 
End Sub

Sub AddStatelistRadioButton(rbt As RadioButton, ImageEnabled As String, ImageChecked As String, ImagePressed As String, mGravity As Int)
    Dim sdw As StateListDrawable
    sdw.Initialize
    Dim bdwEnabled, bdwChecked, bdwPressed As BitmapDrawable
    bdwEnabled.Initialize(LoadBitmap(File.DirAssets, ImageEnabled))
    bdwEnabled.Gravity = mGravity
    bdwChecked.Initialize(LoadBitmap(File.DirAssets, ImageChecked))
    bdwChecked.Gravity = mGravity
    bdwPressed.Initialize(LoadBitmap(File.DirAssets, ImagePressed))
    bdwPressed.Gravity = mGravity
    sdw.AddState(sdw.State_Checked, bdwChecked)
    sdw.AddState(sdw.State_Pressed, bdwPressed)
    sdw.AddCatchAllState(bdwEnabled)
    rbt.Background = sdw
End Sub

I need to hide the radio button circle
 

mr.gedo

Member
Hello @Erel thank you for your advice I tried the B4XRadioButton but I can't make it an image like the above code, I just need to hide or remove circle and keep only image, look to attached image please.

1000082839.jpg
 
Upvote 0
Top