New to Telerik UI for Xamarin? Download free 30-day trial

How to align image and text to the RadButton

Environment

Product Version 2019.2.802.1
Product Button for Xamarin Cross-Platform

Description

This article shows how to add image and text to Button and how to align them.

Solution

RadButton inherits from the Xamarin.Forms Button, so in order to align image and text inside the RadButton control you should use the ContentLayout property of the Button.

  • ContentLayout Defines an object that controls the position of the button image and the spacing between the button's image and the button's text. For more details - check the Xamarin.Forms API Reference.

Example

<telerikInput:RadButton x:Name="rb"
                        Text="Text"
                        Image="image.png"
                        ContentLayout="top,10"/>

where the image is positioned on the top of the button and the spacing between the button's image and button's text is 10.

In this article