mirror of
https://github.com/bitwarden/android.git
synced 2024-11-01 07:35:52 +03:00
34 lines
1 KiB
C#
34 lines
1 KiB
C#
|
using Bit.App.Controls;
|
|||
|
using Bit.iOS.Controls;
|
|||
|
using System.ComponentModel;
|
|||
|
using UIKit;
|
|||
|
using Xamarin.Forms;
|
|||
|
using Xamarin.Forms.Platform.iOS;
|
|||
|
|
|||
|
[assembly: ExportRenderer(typeof(SearchBar), typeof(CustomSearchBarRenderer))]
|
|||
|
namespace Bit.iOS.Controls
|
|||
|
{
|
|||
|
public class CustomSearchBarRenderer : SearchBarRenderer
|
|||
|
{
|
|||
|
protected override void OnElementChanged(ElementChangedEventArgs<SearchBar> e)
|
|||
|
{
|
|||
|
base.OnElementChanged(e);
|
|||
|
|
|||
|
var view = e.NewElement;
|
|||
|
if(view != null)
|
|||
|
{
|
|||
|
Control.SearchBarStyle = UISearchBarStyle.Minimal;
|
|||
|
Control.BarStyle = UIBarStyle.BlackTranslucent;
|
|||
|
Control.ShowsCancelButton = Control.IsFirstResponder;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
|
|||
|
{
|
|||
|
base.OnElementPropertyChanged(sender, e);
|
|||
|
var view = Element;
|
|||
|
Control.ShowsCancelButton = Control.IsFirstResponder;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|