简体   繁体   English

如何在Delphi中更改Listview项的颜色(Firemonkey Android)

[英]How can I change the Color of an Listview Item in Delphi(Firemonkey Android)

How can I change the background color of a ListView Item in Firemonkey (Delphi Android)? 如何在Firemonkey(Delphi Android)中更改ListView项的背景颜色? The Listview itself can be set to transparent, but if I add an Item it has white background/ Listview本身可以设置为透明,但如果我添加一个Item它有白色背景/

I Think you'll need to do this in the style designer 我认为你需要在风格设计师中做到这一点

Right Click on the TListView control and select "Edit Custom Style". 右键单击TListView控件并选择“编辑自定义样式”。 In the Style "Structure" Treeview select the itembackground property and set the color to Null. 在样式“结构”树视图中,选择itembackground属性并将颜色设置为Null。

Remember to select the newly created ListViewStyle in the TListView's property inspector StyleLookup parameter 请记住在TListView的属性检查器StyleLookup参数中选择新创建的ListViewStyle

Maybe you can try to add a TImage component as the background of your items. 也许您可以尝试添加TImage组件作为项目的背景。 Then load a bitmap in it with the correct size and color. 然后使用正确的大小和颜色加载位图。

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

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