--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="Xamarin.Forms.Controls.Issues.Issue4194">
+ <StackLayout>
+ <Label Text="On iOS, after clicking the button, the second SearchBar should appear having same color as the first SearchBar, it should not be dark green " />
+ <SearchBar Text="Visible"
+ BackgroundColor="Lime" />
+ <SearchBar x:Name="SearchBar1"
+ IsVisible="false"
+ BackgroundColor="Lime" />
+ <Button Text="Show"
+ Clicked="Handle_Clicked"
+ HorizontalOptions="Center"
+ VerticalOptions="CenterAndExpand" />
+ </StackLayout>
+</ContentPage>
\ No newline at end of file
--- /dev/null
+using Xamarin.Forms.CustomAttributes;
+using Xamarin.Forms.Internals;
+
+namespace Xamarin.Forms.Controls.Issues
+{
+ [Preserve(AllMembers = true)]
+ [Issue(IssueTracker.Github, 4194, "[iOS] SearchBar changes color if initial state is invisible", PlatformAffected.iOS)]
+
+ public partial class Issue4194 : ContentPage
+ {
+ public Issue4194()
+ {
+#if APP
+ InitializeComponent();
+#endif
+ }
+
+ void Handle_Clicked(object sender, System.EventArgs e)
+ {
+#if APP
+ SearchBar1.IsVisible = true;
+#endif
+ }
+ }
+}
\ No newline at end of file
<DependentUpon>Issue3979.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
+ <Compile Include="$(MSBuildThisFileDirectory)Issue4194.xaml.cs">
+ <DependentUpon>Issue4194.xaml</DependentUpon>
+ <SubType>Code</SubType>
+ </Compile>
<Compile Include="$(MSBuildThisFileDirectory)Issue4136.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Issue4262.cs" />
<Compile Include="$(MSBuildThisFileDirectory)LegacyComponents\NonAppCompatSwitch.cs" />
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
+ <Folder Include="$(MSBuildThisFileDirectory)Controls\" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue2858.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:UpdateDesignTimeXaml</Generator>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
- <Folder Include="$(MSBuildThisFileDirectory)Controls\" />
+ <EmbeddedResource Include="$(MSBuildThisFileDirectory)Issue4194.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </EmbeddedResource>
</ItemGroup>
</Project>
Control.BarTintColor = color.ToUIColor(_defaultTintColor);
- if (color.A < 1)
- Control.SetBackgroundImage(new UIImage(), UIBarPosition.Any, UIBarMetrics.Default);
+ Control.SetBackgroundImage(new UIImage(), UIBarPosition.Any, UIBarMetrics.Default);
// updating BarTintColor resets the button color so we need to update the button color again
UpdateCancelButton();