change MAUI Toast text and background color

Bhuwan 721 Reputation points
2022-08-24T08:27:17.89+00:00

I am using MAUI community toolkit toast and how to change text and background color of toast.

using CommunityToolkit.Maui.Alerts;

var toast = Toast.Make(message, duration, fontSize);

await toast.Show(cancellationToken);

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,579 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yonglun Liu (Shanghai Wicresoft Co,.Ltd.) 43,926 Reputation points Microsoft Vendor
    2022-08-25T06:33:28.533+00:00

    Hello,

    Referring to the official API documentation Toast, you could find there is no such a property or method to change the color of text or background.

    It's recommended to use Snackbar to show an alert with custom color of text and background.

    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

0 additional answers

Sort by: Most helpful

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.