DELPHI FMX 同时使用LONGTAP和TAP
在应用到管理图标时,如长按显示删除标志,单击取消删除标志。
在FMX的手势管理中,只有长按LONGTAP,点击TAP则是单独的事件,不能在同事件中管理。
在执行LONGTAP后,TAP也会被触发?,解决方案,,判断长按和点击是否同位置:
添加变量
TapLoaction:TPointf??;
procedure Tform1.form1Gesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean);?
begin
case EventInfo.GestureID of
igilongtap: begin?
tapLocation:= EventInfo.Location;?
{执行LONGTAP}
end;?
end;?
end;???
procedure Tform1.form1Tap(Sender: TObject; const Point: TPointF);
begin?
if Point<>tapLocation then begin?
tapLocation.X:=0;?
tapLocation.Y:=0;?
{执行Tap}
end;?
end;??
经过测试发现,要更理想的效果,
温馨提示: 本文由Jm博客推荐,转载请保留链接: https://www.jmwww.net/file/42919.html