I just stumbled upon this question while writing a tiny chat application that basically contains a list of scrollable messages, a text entry and a submit button:


The problem with the previously published solution is that you will need to nest two types of scroll that are not recommended by the Xamarin.Forms Documentation . To prevent the keyboard from hiding the recording, I discovered the following hack:
I add a placeholder at the end of the main stack layout. Depending on whether the recording is focused (i.e. the keyboard is visible or not), the height of the placeholder is set to 0 or the height of the keyboard.
// HACK: make entry visible when keyboard open var placeholder = new BoxView { HeightRequest = 0, }; entry.Focused += (sender, e) => placeholder.HeightRequest = 210; entry.Unfocused += (sender, e) => placeholder.HeightRequest = 0; Content = new StackLayout { VerticalOptions = LayoutOptions.Fill, Padding = 5, Children = { whoTable, messageScrollView, new StackLayout { Orientation = StackOrientation.Horizontal, VerticalOptions = LayoutOptions.End, HeightRequest = 70, Children = { entry, sendButton, }, }, placeholder, }, };
Of course, this is not perfect. A particularly stiff keyboard height keyboard should be made more elegant. And probably you should only use it on iOS, not Android.
Falko
source share