Recently I received feedback on the application I am currently developing that the tab transitions are too slow. I’m not sure of a better way, but this process worked for me:
- Copy FMX.TabControl.pas to your project folder
- Update the code to set TTabControl.DefaultSlidingDuration to 0.1
The only drawback was the Woll2Woll Image Control which was built against an older version of the TabControl.pas. If you use third party components which don’t provide source code, you may have a similar problem. In my case, I removed the Woll2Woll components.
The tab transitions now perform well.
If anyone is aware of a better way, please do leave a comment.
Thanks to Mark for this useful tip:
And the following code sample for another approach:
procedure DelayedExecute(const MillisecondDelay: Integer; const AAction: TProc); begin if MillisecondDelay = 0 then AAction() else TThread.CreateAnonymousThread( procedure begin Sleep(MillisecondDelay); TThread.Synchronize(nil, TThreadProcedure(AAction)); end ).Start; end;