Articles in this section
Category / Section

How to wrap text in Xamarin.Forms RadioButton?

1 min read

This article explains how to wrap the Xamarin.Forms radio button text, as shown in the following image.

 

Wrap the text of Xamarin.Forms radio button

 

It has been achieved by using the LineBreakMode property in Xamarin.Forms SfRadioButton. LineBreakMode is an enum type property. It has the following values:

 

CharacterWrap

Wrap at character boundaries.

HeadTruncation

Truncate the head of text.

MiddleTruncation

Truncate the middle of text. This may be done, for example, by replacing it with an ellipsis.

NoWrap

Do not wrap text.

TailTruncation

Truncate the tail of text.

WordWrap

Wrap at word boundaries.

 

Above UI is obtained with the help of WordWrap mode in LineBreakMode as shown in the following code sample.

 

[XAML]

<StackLayout Margin="20">
        <Label Text="Select Recipes" FontSize="20" FontAttributes="Bold" VerticalTextAlignment="Center"/>
        <SyncfusionButtons:SfRadioGroup Padding="0,20,0,0"  HorizontalOptions="FillAndExpand" >
            <SyncfusionButtons:SfRadioButton FontSize="20" LineBreakMode="WordWrap" Text="Fresh Garden Salad with Thousand Island Dressing." />
            <SyncfusionButtons:SfRadioButton FontSize="20" LineBreakMode="WordWrap" Text="Cauliflower Salad." />
            <SyncfusionButtons:SfRadioButton FontSize="20" LineBreakMode="WordWrap" Text="German Potato Salad with Chicken Bacon and Condiments." />
            <SyncfusionButtons:SfRadioButton FontSize="20" LineBreakMode="WordWrap" Text="Japanese Style Wasabi Potato Salad." />
        </SyncfusionButtons:SfRadioGroup>
    </StackLayout>

See also


How to notify the selection changes in Xamarin.Forms RadioButton [SfRadioButton]

How to create a Xamarin.Forms RadioButton

How to get the selected Xamarin.Forms RadioButton

 

 

Conclusion

I hope you enjoyed learning about how to wrap text in Xamarin.Forms Radio Button.

You can refer to our Xamarin.Forms Radio Button feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied