Uitableview Alloy:HeaderView未在TableView内部渲染
请看下面我的代码。标题确实会在表中呈现,但它是空的,并且高度不正确。我尝试了Tianium SDK 3.0.2和3.1,得到了相同的结果 view.tss:Uitableview Alloy:HeaderView未在TableView内部渲染,uitableview,titanium,titanium-mobile,Uitableview,Titanium,Titanium Mobile,请看下面我的代码。标题确实会在表中呈现,但它是空的,并且高度不正确。我尝试了Tianium SDK 3.0.2和3.1,得到了相同的结果 view.tss: "#detail_header": { height: 200 } "#search_icon": { top: 17, left: 14, image: "search_icon.png", width: 19, height: 23 } "#search": { top: 0,
"#detail_header": {
height: 200
}
"#search_icon": {
top: 17,
left: 14,
image: "search_icon.png",
width: 19,
height: 23
}
"#search": {
top: 0,
left: 48,
width: 599,
height: 54,
backgroundColor: "#ffffff",
font: {fontFamily: "Open Sans [Regular]", fontSize: "20"},
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_WORDS,
autocorrect: false,
returnKeyType: Titanium.UI.RETURNKEY_SEARCH
}
"#search_cancel_icon": {
top: 19,
left: 665,
width: 22,
height: 23,
image: "textClear_icon.png",
visible: false
}
"#horizontal_separator": {
top: 55,
left: 321,
height: 1,
width: 703,
backgroundColor: "#e1e1e1"
}
".detail": {
top: 0,
left: 322,
width: 703,
height: Titanium.UI.FILL,
separatorColor: "#ebebeb"
}
<TableView id="recipes" class="detail">
<HeaderView id="detail_header">
<ImageView id="search_icon" onClick="search_icon_click" />
<TextField id="search" hintText="Search for a recipe" onChange="search_change" />
<ImageView id="search_cancel_icon" onClick="search_cancel_icon_click" />
</HeaderView>
</TableView>
view.xml:
"#detail_header": {
height: 200
}
"#search_icon": {
top: 17,
left: 14,
image: "search_icon.png",
width: 19,
height: 23
}
"#search": {
top: 0,
left: 48,
width: 599,
height: 54,
backgroundColor: "#ffffff",
font: {fontFamily: "Open Sans [Regular]", fontSize: "20"},
autocapitalization: Titanium.UI.TEXT_AUTOCAPITALIZATION_WORDS,
autocorrect: false,
returnKeyType: Titanium.UI.RETURNKEY_SEARCH
}
"#search_cancel_icon": {
top: 19,
left: 665,
width: 22,
height: 23,
image: "textClear_icon.png",
visible: false
}
"#horizontal_separator": {
top: 55,
left: 321,
height: 1,
width: 703,
backgroundColor: "#e1e1e1"
}
".detail": {
top: 0,
left: 322,
width: 703,
height: Titanium.UI.FILL,
separatorColor: "#ebebeb"
}
<TableView id="recipes" class="detail">
<HeaderView id="detail_header">
<ImageView id="search_icon" onClick="search_icon_click" />
<TextField id="search" hintText="Search for a recipe" onChange="search_change" />
<ImageView id="search_cancel_icon" onClick="search_cancel_icon_click" />
</HeaderView>
</TableView>
试试这个,我很确定HeaderView属性必须有一个视图作为输入:
<TableView id="recipes" class="detail">
<HeaderView id="detail_header">
<View>
<ImageView id="search_icon" onClick="search_icon_click" />
<TextField id="search" hintText="Search for a recipe" onChange="search_change" />
<ImageView id="search_cancel_icon" onClick="search_cancel_icon_click" />
</View>
</HeaderView>
</TableView>