"Ok" button on DisplayAlert not visible in .nat maui

Thombre, Ashish 125 Reputation points

Platform- Android


private async void OnShowAlertClicked(object sender, EventArgs e) {

await DisplayAlert("Alert Title", "This is an alert message.", "OK");


I am using above DisplayAlert to show popup, but "ok" button not visible on popup. How to resolve this issue?

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

Accepted answer
  1. Leon Lu (Shanghai Wicresoft Co,.Ltd.) 71,836 Reputation points Microsoft Vendor


    Please open your Colors.xml in Platforms/Android/Resources/values/ folder, then find the key called colorPrimary, change another value like following code.

    <color name="colorPrimary">#FF2BD4</color>

    As note: .NET MAUI 7 is end of support on May 14, 2024, Please update .NET 7 to .NET 8

    Best Regards,

    Leon Lu

    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