我需要更改listboxitem被选中时的突出显示颜色。
在android中使用深色样式,当我选择一个项目时,结果很糟糕(文本为白色,项目框为浅蓝色)。
有办法改变高光颜色吗?
最佳答案
颜色的定义可以通过样式文件来实现。
您可以按样式搜索ListBoxItemStyle
,并在其中找到具有TColorAnimation
的Trigger = IsSelected
,您可以在那里更改颜色。
我正在树立我的风格榜样:
object TLayout
StyleName = 'ListBoxItemStyle'
DesignVisible = False
Height = 20.000000000000000000
Width = 50.000000000000000000
object TText
StyleName = 'text'
Align = alClient
Color = claBlack
Height = 18.000000000000000000
HitTest = False
HorzTextAlign = taLeading
Margins.Left = 3.000000000000000000
Margins.Top = 1.000000000000000000
Margins.Right = 3.000000000000000000
Margins.Bottom = 1.000000000000000000
Width = 44.000000000000000000
WordWrap = False
object TColorAnimation
Duration = 0.001000000047497451
PropertyName = 'Color'
StartValue = claBlack
StopValue = claAzure
Trigger = 'IsSelected=true'
TriggerInverse = 'IsSelected=false'
end
end
object TCheckBox
StyleName = 'check'
Align = alLeft
CanFocus = False
DisableFocusEffect = True
Height = 20.000000000000000000
StyleLookup = 'ListBoxItemcheck'
TabOrder = 1
Visible = False
Width = 20.000000000000000000
end
end