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

Thombre, Ashish 125 Reputation points
2024-06-19T14:05:21.46+00:00

Platform- Android

<TargetFrameworks>net7.0-android</TargetFrameworks>

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?

.NET MAUI
.NET MAUI
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
    2024-06-20T03:21:39.57+00:00

    Hello,

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

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

    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