[AC-5664] iOS: SearchBar inside ListView barColor and backgroundColor not working
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Duplicate |
Resolution Date | 2018-03-18T16:11:42.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | 7.1.0.GA, barColor, ios-11, searchBar |
Reporter | Flavio Bontà |
Assignee | Shak Hossain |
Created | 2018-03-18T09:43:34.000+0000 |
Updated | 2018-03-19T04:04:06.000+0000 |
Description
Hi, I have created a simple navigationWindow in Alloy.
Inside the window I have a listView with a searchBar.
SearchBar barColor and backgroundColor do not make changes.
<Alloy>
<NavigationWindow id="index" platform="ios">
<Window id="main">
</Window>
</NavigationWindow>
</Alloy>
"#main": {
title: "test",
largeTitleEnabled: true
}
var counter = 0;
function genData() {
var data = [];
var i = 1;
for (i = 1; i <= 3; i++) {
data.push({ properties: { title: 'ROW ' + (counter + i) } })
}
counter += 3;
return data;
}
var search = Titanium.UI.createSearchBar({
barColor:'red',
backgroungColor: 'green',
showCancel:true,
top:0,
});
var section = Ti.UI.createListSection();
section.setHeaderTitle("title");
section.setItems(genData());
var control = Ti.UI.createRefreshControl({
tintColor: 'red'
})
var listView = Ti.UI.createListView({
sections: [section],
refreshControl: control,
searchView: search
});
control.addEventListener('refreshstart', function(e) {
Ti.API.info('refreshstart');
setTimeout(function() {
Ti.API.debug('Timeout');
section.appendItems(genData());
control.endRefreshing();
}, 100); //if setTimeout is about 1s the problem not occurs
})
$.main.add(listView);
$.index.open();
Attachments
File | Date | Size |
---|---|---|
Simulator Screen Shot - iPhone 8 - 2018-03-18 at 10.40.42.png | 2018-03-18T09:41:00.000+0000 | 30960 |
Hey there! This should be fixed by TIMOB-25850 (cc [~vijaysingh]) and [this pull request](https://github.com/appcelerator/titanium_mobile/pull/9932) that you can use to patch your SDK today. I will resolve the ticket to indicate its relation, thank you for reporting this!
Hans is correct, it will be fixed in above ticket. Simple workaround is - Set searchBar property after creating list view. e.g.
Thanks!