Forum Xamarin.Forms

Fullscreen custom renderer for Android

ErlendAErlendA NOMember ✭✭

I want some content pages to have a transparent background on the navigation bar (toolbar on Android). Since I only need this for a few pages in the app I created a custom renderer: FullscreenPageRenderer.

public class FullscreenPageRenderer : PageRenderer
protected override void OnElementChanged(ElementChangedEventArgs e)
Activity parent = (Activity)Context;
var toolbar = parent.FindViewById(Resource.Id.toolbar);
toolbar.Background = new ColorDrawable(Color.Transparent.ToAndroid());

I want it to look like this image

After setting this properties in my renderer I still get a behavior where my page content is placed beneath the toolbar and not underneath it.
Any suggestions to this is greatly appreciated.


Sign In or Register to comment.