Back to results for “Platform Integration”
.NET MAUI › Controls & Views

How do you customize a control's native appearance without a full custom control?

Advanced

Answer

Use handler mappers to reach into the platform view. AppendToMapping runs after the default mapping so you can tweak native properties per platform, guarded by #if. This avoids subclassing and keeps customization centralized in MauiProgram or a startup routine.
EntryHandler.Mapper.AppendToMapping("NoUnderline", (handler, view) =>
{
#if ANDROID
    handler.PlatformView.BackgroundTintList =
        Android.Content.Res.ColorStateList.ValueOf(
            Android.Graphics.Color.Transparent);
#endif
});
Real-world example A design team removes the Android Entry underline app-wide with one mapper customization instead of a custom renderer.

Common follow-ups: When is a mapper better than a custom control? | How do you scope a mapper to one control?