Titanium 选定TableViewRow中的highlightedColor被卡住
请看我的意思的一个例子。在视频播放20秒后,您就会看到问题 这似乎主要发生在滚动tableview导致所选行离开屏幕时。当您滚动将该行返回屏幕,然后选择新行时,先前选择的行的highlightedColor将保持不变,而不是切换回常规颜色。这不是每次都会发生,但这是我发现的最好的复制方式。这是我的允许代码: 配方列表.xmlTitanium 选定TableViewRow中的highlightedColor被卡住,titanium,tableview,appcelerator,titanium-mobile,appcelerator-mobile,Titanium,Tableview,Appcelerator,Titanium Mobile,Appcelerator Mobile,请看我的意思的一个例子。在视频播放20秒后,您就会看到问题 这似乎主要发生在滚动tableview导致所选行离开屏幕时。当您滚动将该行返回屏幕,然后选择新行时,先前选择的行的highlightedColor将保持不变,而不是切换回常规颜色。这不是每次都会发生,但这是我发现的最好的复制方式。这是我的允许代码: 配方列表.xml <Alloy> <View class="container"> <TableView id="categories"
<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>
请尝试为TableView指定类名。这不起作用,因为您无法以编程方式更改类名。它们必须是硬编码的。
".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"
}