Reproduce
1. Create a simple alloy project with following code.
<Alloy>
<Window fullscreen="true">
<ListView>
<SearchBar barColor="#000" />
<ListSection>
<ListItem title="Papaya" searchableText="Papaya"/>
<ListItem title="Peach" searchableText="Peach"/>
<ListItem title="Pear" searchableText="Pear"/>
<ListItem title="Persimmon" searchableText="Persimmon"/>
<ListItem title="Pineapple" searchableText="Pineapple"/>
<ListItem title="Pluot" searchableText="Pluto"/>
<ListItem title="Pomegranate" searchableText="Pomegranate"/>
</ListSection>
</ListView>
</Window>
</Alloy>
2. Run it on Windows10 device.
Actual
There is no searchBar on screen like the screenshot attached.
Note
1. If create a simple classic project, with following codes, then run it on same device. It is working well.
var win = Ti.UI.createWindow({
backgroundColor: 'green',
layout: 'vertical'
});
var searchBar = Ti.UI.createSearchBar({
width: Ti.UI.FILL,
height: '10%'
});
var listView = Ti.UI.createListView({
searchView: searchBar,
width: Ti.UI.FILL, height: '80%'
});
var sections = [];
var fruitSection = Ti.UI.createListSection({ headerTitle: 'Fruits' });
var fruitDataSet = [
{ properties: { title: 'Apple' } },
{ properties: { title: 'Banana' } },
];
fruitSection.setItems(fruitDataSet);
sections.push(fruitSection);
var vegSection = Ti.UI.createListSection({ headerTitle: 'Vegetables' });
var vegDataSet = [
{ properties: { title: 'Carrots' } },
{ properties: { title: 'Potatoes' } },
];
vegSection.setItems(vegDataSet);
sections.push(vegSection);
listView.sections = sections;
win.add(searchBar);
win.add(listView);
win.open();
2. Tested on SDK 5.5.1.GA, 6.0.0.GA and 6.0.1.
3. Same code is working well on iOS and Android.
[~sliang] This might be an underlying issue with the Windows SDK itself. I suspect that this might be due to TIMOB-24126, on iOS and Android you don't actually need to explicitly add a searchBar to the window when you specify it as searchView for a listview, which would explain why the alloy code works on iOS and Android
Ye. I thinks so. Good one.
[~sliang] Please try with SDK 6.1.0.v20170202120400.