Custom notification views

Sometimes notifications created by the builder just don't provide enough flexibility compared to what is required. Sometimes notifications created by the builder just don't provide enough flexibility or customization. As a result, an entirely custom notification layout is needed to provide this level of customization.

Getting ready

If we are going to support Android versions prior to 3.0, we will have to install the Xamarin Support Library v4 NuGet or component into our project.

How to do it...

We can use RemoteViews with a layout file to provide a custom layout for a notification:

  1. We can also display an entirely custom view in a notification. To do this, we create a RemoteViews object, passing the resource ID of the layout: ...

Get Xamarin Mobile Development for Android Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.