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

Thombre, Ashish 130 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?

Developer technologies | .NET | .NET MAUI
0 comments No comments
{count} votes

Answer accepted by question author
  1. Anonymous
    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

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.