相关疑难解决方法(0)

在firemonkey移动开发中正确使用TAniIndicator等待处理

我正在使用Delphi XE-5(Firemonkey移动应用程序)

我想通过在长时间处理期间显示来让TAniIndicator工作.我的主表单上有一个TAniIndicator(AniIndi),但它没有旋转.它显示正确,但不旋转.

begin
 Loading:= True;
 AniIndi.Visible:= True;
 AniIndi.Enabled:= True;
 UpdateAll;
 Application.ProcessMessages;

 //do my processsing here

 Loading:= False;
 AniIndi.Enabled:= False;
 AniIndi.Visible:= False;
 UpdateAll;
 Application.ProcessMessages;
end;
Run Code Online (Sandbox Code Playgroud)

//基于REMY的答案进行编辑

TLoadThread = class(TThread)
 public
  Config: Boolean;
  constructor Create(const aConfig: Boolean); reintroduce;
 protected
  procedure DoProcessing;
  procedure Execute; Override;
 end;

var
 loading: Boolean = false;
 zLThread: TLoadThread = nil;

constructor TLoadThread.Create(const aConfig: Boolean);
begin
 inherited Create(true);
 Config:= aConfig;
end;

procedure TLoadThread.DoProcessing;
var
begin
 //do processing here and update main form
end;

procedure TLoadThread.Execute;
begin
 FreeOnTerminate:= true; …
Run Code Online (Sandbox Code Playgroud)

delphi firemonkey delphi-xe5

4
推荐指数
1
解决办法
2万
查看次数

标签 统计

delphi ×1

delphi-xe5 ×1

firemonkey ×1