Creating a custom alert view in Android using C#

As mentioned in my earlier post, we can use the default AlertDialog class to display the alerts of screen by setting different properties and methods of it. But still there sounds like, we may need dialogs on screen which would be needed to be customized. They can be accept user inputs, can display an arranged info of an user etc.

How to do it ?

We will follow few simple steps

  • Create a custom view
  • Render the custom view in AlertDialog

Create a custom view

Let’s add a new layout to the project under Resources > layout.

Adding the below code to the newly added layout.

Render the custom view in AlertDialog


Hope this will help đŸ™‚

Categories: Android, CSharp, MonoDroid, Visual Studio, Xamarin

Leave a Reply

%d bloggers like this: