小编Nan*_*Bag的帖子

如何删除listview搜索框中的清除按钮?

我想动态地将一个TEditButton放在ListView的搜索框中,所以我这样做了:

ListView                         := TListView.Create(Self);    
ListView.Parent                  := Self;   
ListView.Name                    := 'hello'; 
ListView.Height                  := 369;  
ListView.Width                   := 369; 
ListView.Align                   := TAlignLayout.Bottom; 
ListView.SearchVisible           := True; 
ListView.BeginUpdate;    

for i := 0 to ListView.controls.Count - 1 do
begin   
  if ListView.controls[i].ClassType = TSearchBox then 
  begin    
    SearchBox := TSearchBox(ListView.controls[i]);
  end; 
end;  

OKbtn := TEditButton.Create(SearchBox);  
OKbtn.Parent := SearchBox;    
OKbtn.Text   := 'OK';  
OKbtn.Width  := 30;   

SearchBox.AddObject(OKbtn);
ListView.EndUpdate;    
Run Code Online (Sandbox Code Playgroud)

但问题是clear button在编辑搜索框时也会出现问题.如何删除搜索框右侧的清除按钮(X)?

delphi android listview firemonkey

9
推荐指数
2
解决办法
1446
查看次数

标签 统计

android ×1

delphi ×1

firemonkey ×1

listview ×1