请参阅my screencast了解我的意思。您在视频中看到问题大约20秒。
似乎主要发生在滚动tableview导致所选行离开屏幕时。当您滚动以将该行重新添加到屏幕上然后选择一个新行时,先前选定的行的highlightColor会保留,而不是切换回常规颜色。它不会发生每个时间,但这是我发现复制的最佳方式。这是我的允许代码:
recipe_list.xml
<Alloy>
<View class="container">
<TableView id="categories" class="master">
<TableViewRow class="category_row">
<Label class="category" text="Appetizers" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Drinks that are extremely complex" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Entrees" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Desserts" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Appetizers" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Drinks that are extremely complex" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Entrees" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Desserts" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Appetizers" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Drinks that are extremely complex" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Entrees" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Desserts" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Appetizers" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Drinks that are extremely complex" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Entrees" />
<View class="separator" />
</TableViewRow>
<TableViewRow class="category_row">
<Label class="category" text="Desserts" />
<View class="separator" />
</TableViewRow>
</TableView>
<View id="vertical_separator" />
</View>
</Alloy>
recipe_list.tss
".container": {
backgroundColor: "white",
height: Titanium.UI.FILL,
top: 0
}
".master": {
top: 0,
left: 0,
width: 320,
// height: Titanium.UI.FILL,
backgroundColor: "#ebeced",
separatorColor: "#d7d7d7",
allowsSelection: true
}
".category_row": {
selectionStyle: Titanium.UI.iPhone.TableViewCellSelectionStyle.BLUE,
selectedBackgroundColor: "#34c2d8"
}
".category": {
font: {fontFamily: "Open Sans [Regular]", fontSize: "20"},
textAlign: Titanium.UI.TEXT_ALIGNMENT_CENTER,
color: "#464646",
highlightedColor: "#fafdff",
top: 15,
bottom: 15,
height: Titanium.UI.SIZE
}
".separator": {
top: 0,
height: 1,
width: Titanium.UI.FILL,
backgroundColor: "#f6f6f7"
}
"#vertical_separator": {
left: 320,
width: 1,
height: Titanium.UI.FILL,
backgroundColor: "#cbcdcf"
}