Delphi XE6 How to change highlight color of TMetropolisUIListBoxItem using style

I need to change the highlight color of a ListBoxItem when it is selected.

Using dark style for Android when I select an element the result is terrible (text colored white and exhibit box light blue).

Is there a way to change the highlight color?

Screenshot

+3


source to share


1 answer


Color definition can be done using a style file. You can search by style ListBoxItemStyle

, and inside it you will find TColorAnimation

which has Trigger = IsSelected

, there you can change the color. I am setting my style example:



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

      

+3


source







All Articles