TListBox에는 약 50 개의 TListboxItem이 포함되어 있습니다. 각 항목에는 레이블로 사용되는 3 개의 텍스트, '상태'를 나타내는 48x48 해상도의 1 개의 TImage 및 항목 선택을위한 확인란이 있습니다. 장치에서 스크롤 할 때 시간이 많이 걸립니다. 종종 불안정하고, 산발적이며, 일관성이 없습니다.TListBox를 스크롤 할 때 지연이 발생했습니다.
너무 많은 항목이 있기 때문에이게 맞습니까? 아니면 TTexts, Timage 등이 포함되어 있기 때문입니까? 또는 TListbox의 스크롤 과정을 부드럽게 처리 할 수있는 방법이 있습니다.
저는 Delphi xe5를 사용하여 iOS 응용 프로그램을 개발하고 있습니다. 나는 TListbox의 'sorted'속성이 다음과 같은지 확인했다 : = False;
UPDATE (제리 닷지에 대응) :
while XMLNode <> nil do begin
Main_Form.LBoxEntries.Items.Add('');
Item1:=Main_Form.LBoxEntries.ListItems[Main_Form.LBoxEntries.Items.Count-1];
Item1.Height := 80;
Item1.Width := ClientWidth;
if XMLNode.ChildNodes['SCANSTATUS'].Text = '0' then begin
Item1.ItemData.Bitmap := Main_Form.Red.Bitmap;
Item1.Tag := 0;
end;
if XMLNode.ChildNodes['SCANSTATUS'].Text = '1' then begin
Item1.ItemData.Bitmap := Main_Form.Orange.Bitmap;
Item1.Tag := 1;
end;
if XMLNode.ChildNodes['SCANSTATUS'].Text = '2' then begin
Item1.ItemData.Bitmap := Main_Form.Green.Bitmap;
Item1.Tag := 2;
end;
Customer := TText.Create(nil);
Customer.Parent := Item1;
Customer.Position.X := 95;
Customer.Position.Y := 8;
Customer.Text := XMLNode.childNodes['CUSTOMERNAME'].text;
Customer.Width := Item1.Width - 105;
Customer.WordWrap := False;
Customer.Color := TAlphaColors.Blue;
Customer.Trimming := TTextTrimming(1);
Customer.Height := 20;
Customer.Font.Size := 18;
Customer.HorzTextAlign := TTextAlign(1);
Customer.Anchors := [TanchorKind.akLeft,TanchorKind.akRight];
Customer.WordWrap := False;
Product := TText.Create(nil);
Product.Parent := Item1;
Product.Position.X := 105;
Product.Position.Y := 30;
Product.Text := 'Product: ' +XMLNode.childNodes['PRODUCT'].text;
Product.Width := Item1.Width - 115;
Product.Trimming := TTextTrimming(1);
Product.Height := 20;
Product.Font.Size := 15;
Product.HorzTextAlign := TTextAlign(1);
Product.Anchors := [TanchorKind.akLeft,TanchorKind.akRight];
Product.WordWrap := False;
QTY := TText.Create(nil);
QTY.Parent := Item1;
QTY.Position.X := 105;
QTY.Position.Y := 50;
QTY.Text := 'QTY: ('+XMLNode.childNodes['QTY'].text+')';
QTY.Width := Item1.Width - 115;
QTY.Trimming := TTextTrimming(1);
QTY.Height := 20;
QTY.Font.Size := 15;
QTY.HorzTextAlign := TTextAlign(1);
QTY.Anchors := [TanchorKind.akLeft,TanchorKind.akRight];
QTY.WordWrap := False;
Item1.ItemData.Detail := ' |' + XMLNode.childNodes['SID'].Text+'|'+
' |' + XMLNode.childNodes['CUSTOMERNAME'].Text+'|'+
' |' + XMLNode.childNodes['PRODUCT'].text+'|'+
' |' + XMLNode.childNodes['QTY'].Text+'| ';
XMLNode := XMLNode.NextSibling;
end;
Main_Form.LBoxEntries.EndUpdate;
아무 게시물 작업은/이벤트 항목에 연결되지 않습니다.
자세한 내용을 알지 못해서 적절한 답을 얻는 것은 사실상 불가능합니다. 이 목록 상자에 연결된 이벤트가 있습니까? 항목은 어떻게 추가됩니까? 공유 할 수있는 관련 코드가 있습니까? –
업데이트 됨. 고맙습니다, @JerryDodge – ThisGuy
이 목록에 많은 데이터가 있다는 것 같습니다. 이 지연을 방지하는 방법을 말하기가 어렵습니다. –