• Delphi XE5 android listview


    C:UsersPublicDocumentsRAD Studio12.0SamplesFireMonkeyMobileListView

    路径下有两个dpk,装完后listview也能实现listbox的效果了

    procedure TFormMain.FillListBox;
    var
      // item:TMetropolisUIListBoxItem;
      // listitem:TListboxItem;
    
      p: PpatientData;
      LItem: TListViewItem;
      i: Integer;
    begin
      ListViewPatient.Items.Clear;
      if not cdspatientlist.Active then
        Exit;
      ListViewPatient.BeginUpdate;
      try
        with cdspatientlist do
        begin
          DisableControls;
          try
            i := 1;
            First;
            while not Eof do
            begin
              New(p);
              p.patient_id := FieldByName('patient_id').AsString;
              p.admiss_times := FieldByName('admiss_times').AsInteger;
              p.inpatient_no := FieldByName('inpatient_no').AsString;
              p.bed_no := FieldByName('bed_no').AsString + '';
              p.nurse_level := FieldByName('nurse_level').AsString;
              p.diag := FieldByName('diag').AsString;
              p.name := FieldByName('name').AsString;
              p.sex := FieldByName('sex').AsString;
              p.age := FieldByName('age').AsString;
              p.charge_total := FieldByName('charge_total').AsString;
              p.yue := FieldByName('yue').AsString;
    
              LItem := ListViewPatient.Items.Add;
              LItem.Text := p.bed_no;
    
              LItem.Data[TMultiDetailAppearanceNames.Detail1] := '姓名    :' + p.name;
              LItem.Data[TMultiDetailAppearanceNames.Detail2] := '护理等级:' +
                p.nurse_level;
              LItem.Data[TMultiDetailAppearanceNames.Detail3] := '诊断    :' + p.diag;
    
              if p.sex = '' then
                LItem.BitmapRef := (Image1.MultiResBitmap.Items[0].Bitmap)
              else if p.sex = '' then
    
                LItem.BitmapRef := (Image1.MultiResBitmap.Items[1].Bitmap);
    
              if p.sex = '1' then
                LItem.BitmapRef := Image1.MultiResBitmap.Items[1].Bitmap
              else
                LItem.BitmapRef := Image1.MultiResBitmap.Items[0].Bitmap;
    
              Inc(i);
              Next;
    
            end;
          finally
            EnableControls;
          end;
    
        end;
      finally
        ListViewPatient.EndUpdate;
      end;
    
    end;
    View Code

  • 相关阅读:
    Java解惑之TreeSet是如何去重的
    Spring.profiles多环境配置最佳实践
    设计模式-单例模式的5种实现
    JAVA实现单双向链表的增、删、改、查
    RxJava/RxAndroid 使用实例实践
    数学模型与计算机科学的认知
    Mac下TensorFlow安装及环境搭建
    2017年Android百大框架排行榜
    python 多线程就这么简单
    python 内置模块之hashlib、hmac、uuid
  • 原文地址:https://www.cnblogs.com/nywh2008/p/3370286.html
Copyright © 2020-2023  润新知