Titanium 当两个表视图位于同一视图上时,钛合金表视图将消失
这是一个移动应用程序,运行在iPhone模拟器上,使用SDK V3.0.2 GA和Alloy框架 我有一个窗口,其中有一个表视图,在该表视图顶部有一个自动完成的搜索栏。当autocomplete开始启动时,它会在搜索框下方显示一个带有结果的tableview,允许用户从结果中进行选择 这一切都很好,除了在搜索视图中包含TableView会导致原始窗口中的TableView消失 代码如下: myPlaces.xmlTitanium 当两个表视图位于同一视图上时,钛合金表视图将消失,titanium,appcelerator,titanium-alloy,Titanium,Appcelerator,Titanium Alloy,这是一个移动应用程序,运行在iPhone模拟器上,使用SDK V3.0.2 GA和Alloy框架 我有一个窗口,其中有一个表视图,在该表视图顶部有一个自动完成的搜索栏。当autocomplete开始启动时,它会在搜索框下方显示一个带有结果的tableview,允许用户从结果中进行选择 这一切都很好,除了在搜索视图中包含TableView会导致原始窗口中的TableView消失 代码如下: myPlaces.xml <Alloy> <Window id="myDrawersW
<Alloy>
<Window id="myDrawersWin">
<RightNavButton>
<Button id="showMyDrawers" title="Show Drawers" />
</RightNavButton>
<Require src="findPlace" id="findPlace"/>
<TableView id="placeListTable"/>
</Window>
</Alloy>
<Alloy>
<View id="searchContainer">
<TextField id="searchInput" hintText="Find a place..." />
</View>
<TableView id="searchResultsTable"/>
</Alloy>
"#searchContainer":{
width: "100%",
height: 50,
backgroundColor: "#B8D0DB",
top: 0
}
"#searchInput":{
width: "80%",
height: 30,
backgroundColor: "#FFFFFF"
}
"#searchResultsTable":{
width: "80%",
visible: false
}
findPlace.xml
<Alloy>
<Window id="myDrawersWin">
<RightNavButton>
<Button id="showMyDrawers" title="Show Drawers" />
</RightNavButton>
<Require src="findPlace" id="findPlace"/>
<TableView id="placeListTable"/>
</Window>
</Alloy>
<Alloy>
<View id="searchContainer">
<TextField id="searchInput" hintText="Find a place..." />
</View>
<TableView id="searchResultsTable"/>
</Alloy>
"#searchContainer":{
width: "100%",
height: 50,
backgroundColor: "#B8D0DB",
top: 0
}
"#searchInput":{
width: "80%",
height: 30,
backgroundColor: "#FFFFFF"
}
"#searchResultsTable":{
width: "80%",
visible: false
}
如果我在findPlace.xml
中取出TableView,窗口上的原始TableView(placeListTable)将显示良好。如果我把它加回去,它就会消失。此外,如果我将TableView移动到
的内部,它将显示出来(但显然,由于searchContainer
的高度限制,它不适合)
有什么想法吗?这是一只虫子,还是我在做傻事
谢谢你的帮助
贾斯汀找到了这个问题的解决办法,正如我所怀疑的,这是愚蠢的 问题是我在窗口样式表上设置了
layout:vertical
,这意味着第二个TableView显示在另一个TableView的下方。解决了这个问题