Is this correct way how to dynamically show many controls (labels in rectangles) ? Because it takes about 26s which seems slow to me.
This is my code:
...
DPFUIScrollView1.beginupdate;
for i := 0 to 180 do
begin
for j := 0 to 16 do
begin
view := TDPFUIView.create(nil);
view.Width := w;
view.Height:=h;
view.Position.X := jw;
view.Position.Y := ih;
DPFUIScrollView1.AddControl(view);
Creating over 1000 control not a better way, but i improved adding controls into ScrollView
You can calculate controls size and ScrollView contentsize and call view.AddControl(lbl, false); with false parameter. after calling AddControl dont call lbl.Loaded;
regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is this correct way how to dynamically show many controls (labels in rectangles) ? Because it takes about 26s which seems slow to me.
This is my code:
...
DPFUIScrollView1.beginupdate;
for i := 0 to 180 do
begin
for j := 0 to 16 do
begin
view := TDPFUIView.create(nil);
view.Width := w;
view.Height:=h;
view.Position.X := jw;
view.Position.Y := ih;
DPFUIScrollView1.AddControl(view);
end;
DPFUIScrollView1.endupdate;
Even when I use only 80x20 I'm waiting 9s.
Or is this normal time in pure obj-c?
Hi Michal
Creating over 1000 control not a better way, but i improved adding controls into ScrollView
You can calculate controls size and ScrollView contentsize and call view.AddControl(lbl, false); with false parameter. after calling AddControl dont call lbl.Loaded;
regards