简体   繁体   English

无法在Android设备Delphi XE7上滚动ListView

[英]Can't scroll listview on Android device Delphi xe7

Can't scroll Listview in Delphi Xe7 on Android device. 无法在Android设备上的Delphi Xe7中滚动Listview。 Some of my listviews can scroll, but not all of them. 我的某些列表视图可以滚动,但不能全部滚动。 They all work on iOS. 它们都可以在iOS上使用。

Here is my code for a problem ListView 这是我的问题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;

UPDATE After messing around and recompiling a few times I've noticed two things: 更新在弄乱并重新编译几次之后,我注意到了两件事:

1) This only happens to Listviews on which the style for the items are set to 'ImageListItemBottomDetail' 1)仅在将项目样式设置为“ ImageListItemBottomDetail”的Listview上发生

2) This issue is not consistent... For example, I have a tab control with two tabs which contain a listview in each tab. 2)这个问题不一致。例如,我有一个带有两个选项卡的选项卡控件,每个选项卡中都包含一个列表视图。 Identical Listviews, all except for the name. 相同的Listviews,除了名称以外的所有视图。 First time I ran the app, neither would scroll, second time I ran the app ( just closed app and restarted, no changes ) the first Listview scrolled but not the listview on the second tab. 第一次运行该应用程序时,不会滚动,第二次运行该应用程序(仅关闭应用程序并重新启动,没有更改),第一个Listview滚动了,但第二个选项卡上的listview却没有滚动。 restarted app again, this time they both do not work again. 重新启动了应用程序,这一次它们都不再起作用。

Delphi bug? 德尔福漏洞? Issue not apparent on iOS 问题在iOS上不明显

not sure if this will fix your exact problem in Delphi XE-7 but in my case [delphi-xe10.2.3 Tokyo] took me a while to figure i forgot to [ end list view update] ^^' Form1.ListView1.EndUpdate; 不知道这是否可以解决您在Delphi XE-7中的确切问题,但是在我的情况下,[delphi-xe10.2.3 Tokyo]花了我一段时间才使我忘记了[结束列表视图更新] ^^'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.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM