2010-11-11 53 views
0

我正在玩Titanium Mobile。我构建了一个TableView并在iPhone上测试它。所有工作正常,我启用了TableView的“选择”属性。Titanium Mobile - 选择一行时在TableVIew中反转文字颜色

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

任何想法?

THX 沙皇

回答

3

我不知道,如果你在你的细胞有UILabels,但是处理这种基本的方法是通过属性的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 
+0

我建立内有多个Titanium.Ui.Labels的自定义行。根据API,只有行本身可以具有“选择...”值。任何其他想法? – Czar 2010-11-11 16:25:46

+0

然后它变得复杂..你将不得不管理更新每个元素的UI时,他们被选中 – 2010-11-11 17:01:19

+0

你可能有任何代码snipplet我可以用作起点吗? – Czar 2010-11-13 14:33:14