How can I use Material RadioButton in iOS as Right to left?

124 Views Asked by At

I use Material pod library for adding radioButton to iOS app. but it has an issue in right to left languages. it's label shows on right and I wondering if there is a way to put its label to left of radioIcon. here is my code:

    rdGroup = RadioButtonGroup()
    
    let rd1 = RadioButton()
    rd1.title = "My Right to left title"
    rd1.isSelected = true
    rdGroup!.buttons.append(rd1)
    
    let rd2 = RadioButton()
    rd2.title = "My Right to left title"
    rdGroup!.buttons.append(rd2)
1

There are 1 best solutions below

0
On

After browsing source code of Material I found out that it's a Button. Then should just use this:

rd1.semanticContentAttribute = .forceRightToLeft
rd1.contentHorizontalAlignment = .left

on each radioItem.

happy coding ;)