The searchbar in forms doesn't appear on Android 7.0 devices, I am compiling with Android 6.0 not the latest version. The issue is apparently a google problem with calculating a height of the searchbar that results in a height of zero, thus no searchbar. I want to implement a searchbar size in XAML and only affect Android. Apparently, if I don't set the HeightRequest, Forms will use a default value or zero, so now the problem propagates to the other platforms. I read somewhere that if I set the HeightRequest to -1, it is invalid and Xamarin will calculate/default a height that makes sense and I can simply override the height for Android. I currently have this code in my XAML and it appears to work. I don't want to make a custom renderer, especially since the problem is apparently fixed in Android 7.1.
Anyone have a better solution?
Thanks Alan
<SearchBar Text="{Binding Search}" Placeholder="Search order list" SearchCommand="{Binding SearchCommand}" >
<SearchBar.HeightRequest>
<OnPlatform x:TypeArguments="x:Double"
iOS="-1.0"
Android="40.0"
WinPhone="-1">
</OnPlatform>
</SearchBar.HeightRequest>
</SearchBar>