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

iOS: cannot set the PlatformView.BarTintColor for the SearchBar #17254

Open
vasile135 opened this issue Sep 7, 2023 · 3 comments
Open

iOS: cannot set the PlatformView.BarTintColor for the SearchBar #17254

vasile135 opened this issue Sep 7, 2023 · 3 comments
Labels
area-controls-entry Entry custom-handler 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

@vasile135
Copy link

vasile135 commented Sep 7, 2023

Description

Trying to achieve a transparent SearchBar background on iOS by using the SearchBarHandler Mapper.
The BarTintColor never changes:
image

Steps to Reproduce

Appended the following to the SearchBarHandler Mapper:
image
The app doesn't react to the BarTintColor change and continues to display a gray background.
Noticed the following warning:
image

My workloads:
image
Tested also with .NET 6 - same.

Link to public reproduction project repository

https://github.com/vasile135/SearchBarTintColorTest

Version with bug

7.0.92

Is this a regression from previous behavior?

No, this is something new

Last version that worked well

Affected platforms

iOS

Affected platform versions

iOS 16.6

Did you find any workaround?

No

Relevant log output

No response

@vasile135 vasile135 added the t/bug Something isn't working label Sep 7, 2023
@samhouts samhouts added potential-regression This issue described a possible regression on a currently supported version., verification pending platform/iOS 🍎 area-controls-entry Entry custom-handler labels Sep 7, 2023
@ghost ghost added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Sep 7, 2023
@samhouts samhouts removed the potential-regression This issue described a possible regression on a currently supported version., verification pending label Sep 7, 2023
@PureWeen PureWeen added this to the Backlog milestone Sep 22, 2023
@ghost
Copy link

ghost commented Sep 22, 2023

We've added this issue to our backlog, and we will work to address it as time and resources allow. If you have any additional information or questions about this issue, please leave a comment. For additional info about issue management, please read our Triage Process.

@XamlTest XamlTest added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Dec 5, 2023
@XamlTest
Copy link

XamlTest commented Dec 5, 2023

Verified this on Visual Studio Enterprise 17.9.0 Preview 1(8.0.3). Repro on iOS 17.0 with below Project:
SearchBarTintColorTest.zip

@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
@RobFrancisAu
Copy link

RobFrancisAu commented May 22, 2024

UPDATE 2:

Having finally achieved what I set out to do I thought I'd post the result.

iPhone_14

NOTE : All colours behind the white search entry belong to the page itself, not the SearchBar.

// Remove the top and bottom grey lines which belong to the SearchBar.
// SearchBarStyle.Minimal also does this however it then also gives the SearchTextField a grey colour that I was unable to remove.
handler.PlatformView.BackgroundImage = new UIImage();

//Sets the background colour of the Search text field.
handler.PlatformView.SearchTextField.BackgroundColor = searchBar.ForegroundColor.ToPlatform(); // This colour is coming from control I extended.

UPDATE 1 :

It appears the thing you're looking for is handler.PlatformView.SearchTextField.BackgroundColor

ORIGINAL QUESTION :

I've just run into this problem. Has anyone found a workaround for this yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-entry Entry custom-handler 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

No branches or pull requests

6 participants