FMX FormVirtualKeyboardShown shows not correct bounds for Kboard

  

In my android app i want the VKBoard not to overlap the edit control so i use the FormVirtualKeyboardShown event (from Embarcadero’s example) to find the upper edge of VKboard.

procedure TTabbedForm.FormVirtualKeyboardShown(Sender: TObject; KeyboardVisible: Boolean; const Bounds: TRect);
var h,dh : single;
begin
FKBBounds := TRectF.Create(Bounds);
FKBBounds.TopLeft := ScreenToClient(FKBBounds.TopLeft); // topLeft isn’t right
h := PanelEdit.AbsoluteRect.Top; // h is right
if h > FKBBounds.Top – PanelEdit.Height then movePanelEdit;
end;

but FKBBounds.TopLeft.Y takes a value near the bottom of the screen.
What i’m missing ?

Comments are closed.