我想将 SearchView 添加到另一个视图。我无法将其放置到 ActionBar(我隐藏本机 actionBar 并改为创建自定义视图)。
当我将它添加到 View 并将search:searchBar设置为 TableView 时,我的应用程序崩溃了。
我使用 Appcelerator Studio,平台是 Android
这是我使用的代码:
var searchBar = Ti.UI.createSearchBar({
hintText:"",
color:"#000000",
barColor:"#eaeaea",
height:40,
borderColor:"#ffffff",
backgroundColor:"#ffffff",
showCancel:false
});
var prevadzkyListView = Ti.UI.createListView({
top:55,
templates:{'simple':cTemplate},
separatorStyle:1,
width:width,
height:height-80,
backgroundColor: 'transparent',
editing: false,
moving: false,
visible: true,
scrollable:true,
searchView:searchBar,
resultsBackgroundColor: "#c0392b",
});