其他分享
首页 > 其他分享> > android-Delphi XE6如何使用样式更改TMetropolisUIListBoxItem的突出显示颜色

android-Delphi XE6如何使用样式更改TMetropolisUIListBoxItem的突出显示颜色

作者:互联网

选择ListBoxItem时,我需要更改其突出显示颜色.

Android中使用深色样式时,当我选择一个Item时,结果会很糟糕(文本为白色,项目框为浅蓝色).

有没有办法改变高光颜色?

解决方法:

颜色的定义可以通过样式文件进行.
您可以按样式ListBoxItemStyle进行搜索,在其中可以找到具有Trigger = IsSelected的TColorAnimation,您可以在其中更改颜色.
我以我的风格为例:

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

标签:firemonkey,android,delphi
来源: https://codeday.me/bug/20191121/2049826.html