Xamarin forms : Change back icon of Shell.BackButtonBehavior

Uragonda, Rajesh 31 Reputation points
2021-12-06T15:50:29.123+00:00

Using IconOverride we are unable to change the icon of the back button.

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:resources="clr-namespace:ET.Res"
             xmlns:controls="clr-namespace:ET.Con"
             x:Class="ET.Views.Browse">
    <Shell.BackButtonBehavior>
        <BackButtonBehavior 
                            IconOverride="action_back.png" />

    </Shell.BackButtonBehavior>
Developer technologies .NET Xamarin
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. JarvanZhang 23,971 Reputation points
    2021-12-07T01:38:43.327+00:00

    Hello @Uragonda, Rajesh ,​

    Welcome to our Microsoft Q&A platform!

    Using IconOverride we are unable to change the icon of the back button

    Is the icon not changed? Or it's displayed as a white square background? For the first case, the icon file may not be placed in the resource folder of each platform. Please make sure that image files are added to each platform project. For more details about this, you can refer to this document.

    In the second case, the problem lies in the image file itself. The background of the icon file needs to be transparent. You can download the 'back.png' icon of the official sample for test to check the problem.

    Best Regards,

    Jarvan Zhang


    If the response is helpful, 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.


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.