Skip to content

Instantly share code, notes, and snippets.

@yinyue200
Last active July 6, 2017 03:46
Show Gist options
  • Save yinyue200/5a2ed916f176581b080d8b7395c52493 to your computer and use it in GitHub Desktop.
Save yinyue200/5a2ed916f176581b080d8b7395c52493 to your computer and use it in GitHub Desktop.
//*********************************************************
//
// Copyright (c) yinyue200.com. All rights reserved.
// This code is licensed under the MIT License (MIT).
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
using Android.OS;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;
[assembly: ExportEffect(typeof(yfxsApp.Controls.Effects.SearchBarUnexceptDisappearFixEffect), nameof(yfxsApp.Controls.Effects.SearchBarUnexceptDisappearFixEffect))]
namespace yfxsApp.Controls.Effects
{
class SearchBarUnexceptDisappearFixEffect : PlatformEffect
{
protected override void OnAttached()
{
if(Build.VERSION.SdkInt==BuildVersionCodes.N&&Element is SearchBar sb)
{
sb.HeightRequest = 48;
}
}
protected override void OnDetached()
{
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment