Using Xamarin Forms, consider the Xaml below.
Expanding on the answer from @Falko, you can check the platform for iOS since Android handles this as expected natively.
I also added this to the page for quick and dirty orientation via this answer.
static bool IsPortrait(Page p) { return p.Width < p.Height; }
Anyway, I understand that Xamarin are adding some solutions for this soon. For now, though...
protected async void Message_Focused(object sender, EventArgs args)
{
if (Device.OS == TargetPlatform.iOS)
{
//TLR: still need a way to determine the iOS keyboard's height first
//until then, this is a functional hack
if (IsPortrait(this))
{
KeyboardSpacer.HeightRequest = 165;
}
else
{
KeyboardSpacer.HeightRequest = 114;
}
}
}
protected async void Message_Unfocused(object sender, EventArgs args)
{
if (Device.OS == TargetPlatform.iOS)
{
KeyboardSpacer.HeightRequest = 0;
}
}