Radio button position

Jassim Al Rahma 1,616 Reputation points
2022-10-06T15:25:30.883+00:00

Hi,

I have the following code:

<RadioButton x:Name="RadioButtonAuto" GroupName="RadioDisplay" Grid.Column="0" HeightRequest="100" Value="Auto" CheckedChanged="RadioButtonDisplay_CheckedChanged">  
<RadioButton.Content>  
        <StackLayout>  
            <Image WidthRequest="50" HeightRequest="50" HorizontalOptions="Center" VerticalOptions="Center">  
            <Image.Source>  
                <FontImageSource FontFamily="FontSolid" Glyph="&#xf186;" Color="Black" />  
            </Image.Source>  
            </Image>  
            <Label Text="Auto" HorizontalOptions="Center" VerticalOptions="End" />  
        </StackLayout>  
</RadioButton.Content>  
</RadioButton>  

and I am getting this output:

248135-screen-shot-2022-10-06-at-72246-pm.png

How can I change the radio button position to show like this:

248156-screen-shot-2022-10-06-at-72503-pm.png

Developer technologies .NET .NET MAUI
{count} votes

1 answer

Sort by: Most helpful
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 50,126 Reputation points Microsoft External Staff
    2022-10-07T01:53:42.093+00:00

    Hello,

    You need to redefine the style of RadioButton with with a ControlTemplate.

    Please refer to Redefine RadioButton appearance.

    You could use the code in the documentation to achieve the desired effect.

    Best Regards,

    Alec Liu.


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.