the following fixed code is from here (Link)
...
function TCommonCustomForm.FindTarget(P: TPointF; const Data: TDragObject): IControl;
var
i: Integer;
NewObj: IControl;
begin
Result := nil;
for i := 0 to ChildrenCount - 1 do
// add an exception for layouts
if Supports(Children[i], IControl, NewObj) and NewObj.Visible and (NewObj.HitTest or (NewObj is TLayout)) then
begin
NewObj := NewObj.FindTarget(P, Data);
if Assigned(NewObj) then
Exit(NewObj);
end;
end
...
PS. you need to include FMX.Layouts in FMX.Forms.pas like this:
...
implementation
uses
System.Variants,
System.Generics.Defaults,
System.RTLConsts,
System.Rtti, System.Actions,
System.Math.Vectors,
FMX.Consts,
FMX.Dialogs,
// fix drag and drop buf in tlayout , see "FindTarget"
FMX.Layouts,
FMX.Platform, FMX.Menus,
FMX.TextLayout.GPU,
FMX.Filter, FMX.Materials, FMX.Text,
FMX.Gestures;
...
沒有留言:
張貼留言