无法在 Android 设备上的 Delphi Xe7 中滚动 Listview。我的一些 ListView 可以滚动,但不是全部。他们都在 iOS 上工作。
这是我的问题 ListView 的代码
if AResult=true then
begin
AccessList.BeginUpdate;
try
XMLDocument.LoadFromXML(XMLData);
XMLNode:=XMLDocument.DocumentElement.ChildNodes['Record'];
while XMLNode<>nil do
begin
LItem:=AccessList.Items.Add;
LItem.Text:=XMLNode.ChildNodes['NAME'].Text;
LItem.Detail:=XMLNode.ChildNodes['US1_LOGIN'].Text;
if LItem.Detail='' then
begin
LItem.Detail:='Mobile Access not setup';
LItem.Objects.DetailObject.TextColor:=TAlphaColors.Crimson;
LItem.Objects.DetailObject.Font.Size:=9.5;
end;
LItem.Tag:=StrToInt(XMLNode.ChildNodes['ID_Nr'].Text);
if XMLNode.ChildNodes['US1_DELETED'].Text='0' then
LItem.Objects.AccessoryObject.Visible:=true
else
LItem.Objects.AccessoryObject.Visible:=false;
XMLNode:=XMLNode.NextSibling;
end;
finally
AccessList.EndUpdate;
toggleBusy(false);
end;
end;
更新
在搞砸并重新编译几次之后,我注意到了两件事:
1)这只发生在项目样式设置为“ImageListItemBottomDetail”的Listviews上
2)这个问题并不一致......例如,我有一个带有两个选项卡的选项卡控件,每个选项卡中都包含一个 ListView 。相同的 ListView ,除了名称。我第一次运行应用程序时,也不会滚动,第二次运行应用程序(刚刚关闭应用程序并重新启动,没有更改)第一个 Listview 滚动但不是第二个选项卡上的 listview。再次重新启动应用程序,这次他们都不再工作了。
德尔福漏洞?
问题在 iOS 上不明显
最佳答案
不确定这是否会解决您在 Delphi XE-7 中的确切问题
但就我而言 [delphi-xe10.2.3 Tokyo] 花了我一段时间才发现我忘了 [结束 ListView 更新] ^^'
Form1.ListView1.EndUpdate; <--
Form1.ListView1.BeginUpdate;
try
begin
LVI:= Form1.ListView1.items.add;
LVI.Text := sCH.Strings[1];
end;
except
end;
Form1.ListView1.EndUpdate; // this part is important scroll will not work without it .. in my case.
关于android - 无法在 Android 设备 Delphi xe7 上滚动 ListView ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28992991/