Skip to content

iOS Picker and Entry have borders by default #30806

@BlueRaja

Description

@BlueRaja

Description

On iOS, both <Picker> and <Entry> have borders by default. I consider this a bug because

A. It's different from Android, so you end up with different behavior on different platforms

B. Neither of these components have any Border* properties. In order to remove the border, you need to add a custom native handler.

C. If I wanted a border, I could easily add one using a <Border> component. But removing one is a hassle.

Steps to Reproduce

  1. Use a <Picker> or <Entry> in iOS

Expected results:
Ideally, it would default to having a border (in both iOS and Android), but the border could easily be removed with a BorderWidth property or something. But failing that, I think it should default to no border.

Actual results:
Border exists and can't be removed without native code.

Link to public reproduction project repository

No response

Version with bug

9.0.90 SR9

Is this a regression from previous behavior?

Yes, this used to work in Xamarin.Forms

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

No response

Did you find any workaround?

Microsoft.Maui.Handlers.PickerHandler.Mapper.PrependToMapping("MyApp.PickerHandler", (handler, view) =>
{
    // Remove border around native picker element
    handler.PlatformView.BorderStyle = UITextBorderStyle.None;
});

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Labels

    s/needs-infoIssue needs more info from the authort/bugSomething isn't workingt/enhancement ☀️New feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions