Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SearchBar background not changing on iOS #6555

Closed
emorell96 opened this issue Apr 27, 2022 · 1 comment · Fixed by #7794
Closed

SearchBar background not changing on iOS #6555

emorell96 opened this issue Apr 27, 2022 · 1 comment · Fixed by #7794
Assignees
Labels
area-controls-searchbar SearchBar control fixed-in-6.0.408 Look for this fix in 6.0.408! good first issue Good for newcomers legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor p/2 Work that is important, but is currently not scheduled for release platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Milestone

Comments

@emorell96
Copy link

emorell96 commented Apr 27, 2022

Description

SearchBar has a black background kind of frame and setting BackgroundColor doesn't change it:

How it should work on Android:

image

How it doesn't work on IOS:

image

Steps to Reproduce

  1. Create a new MAUI app
  2. Add a SearchBar
  3. Set the background color.
  4. See it not work.

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

iOS

Affected platform versions

ios 15

Did you find any workaround?

Using the handler allowed me to remove the background (the idea was taken from this stack overflow answer https://stackoverflow.com/a/67327638/6451669)

Microsoft.Maui.Handlers.SearchBarHandler.Mapper.AppendToMapping("NoBackground", (h, v) =>
        {
            h.PlatformView.SearchBarStyle = UIKit.UISearchBarStyle.Minimal;
        });

You can use this to change the background:

Microsoft.Maui.Handlers.SearchBarHandler.Mapper.AppendToMapping("BackgroundBlue", (h, v) =>
        {
            h.PlatformView.BarTintColor = Colors.Blue.ToPlatform();
        });

Relevant log output

No response

@emorell96 emorell96 added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 27, 2022
@v-longmin v-longmin added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 28, 2022
@v-longmin
Copy link

Verified repro on iOS15.4 with VS 17.3.0 Preview 1.0 [32414.199.main]. Repro with above code.

@jsuarezruiz jsuarezruiz self-assigned this Apr 28, 2022
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Apr 28, 2022
@Redth Redth added this to the 6.0.300 milestone May 3, 2022
@jsuarezruiz jsuarezruiz added the good first issue Good for newcomers label May 3, 2022
@jsuarezruiz jsuarezruiz removed their assignment May 3, 2022
@davidortinau davidortinau added the p/2 Work that is important, but is currently not scheduled for release label May 3, 2022
@samhouts samhouts modified the milestones: 6.0.300, 6.0.300-servicing May 5, 2022
@jsuarezruiz jsuarezruiz self-assigned this Jun 6, 2022
@mattleibow mattleibow modified the milestones: 6.0-servicing, 6.0-sr2 Jun 6, 2022
@Redth Redth closed this as completed Jun 24, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 24, 2022
@samhouts samhouts added the fixed-in-6.0.408 Look for this fix in 6.0.408! label Feb 17, 2023
@samhouts samhouts added the area-controls-searchbar SearchBar control label Oct 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-searchbar SearchBar control fixed-in-6.0.408 Look for this fix in 6.0.408! good first issue Good for newcomers legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor p/2 Work that is important, but is currently not scheduled for release platform/iOS 🍎 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants