【问题标题】:Titanium Mobile - Invert text color in TableVIew when selecting a rowTitanium Mobile - 选择行时反转 TableVIew 中的文本颜色
【发布时间】:2010-11-11 13:12:15
【问题描述】:

我正在玩 Titanium Mobile。我构建了一个 TableView 并在 iPhone 上进行了测试。一切正常,我为 TableView 启用了“选择”属性。

我无法轻易弄清楚如何在文本颜色中inver,以便选择一行时,背景是蓝色的,文本s从我的黑色或灰色切换到白色,以便对比度就像在 iPhone 上。

有什么想法吗?

THX 沙皇

【问题讨论】:

    标签: colors selection cell tableview titanium


    【解决方案1】:

    我不知道您的单元格中是否有 UILabel,但处理此问题的基本方法是通过 API 提供的属性

    See API Documentation

    selectedBackgroundColor - the background color to render when the row cell is selected
    selectedBackgroundImage - the background image to render when the row cell is selected
    selectedColor           - color of the row during selection
    

    【讨论】:

    • 我建立了一个自定义行,里面有几个 Titanium.Ui.Labels。根据 API,只有行本身可以具有“选定...”值。还有其他想法吗?
    • 那么事情就变得复杂了......当每个元素被选中时,您将不得不单独管理更新每个元素的 UI
    • 你有什么代码片段可以作为起点吗?
    猜你喜欢
    • 2021-11-13
    • 1970-01-01
    • 2015-07-03
    • 1970-01-01
    • 1970-01-01
    • 2012-11-10
    • 2021-10-09
    • 2014-12-17
    • 1970-01-01
    相关资源
    最近更新 更多