Problem description
Device rotation impacts on the visualization of the search bar. The bar disappears if there is text in it and device is rotated, or if the search button on the virtual keyboard is pressed.
Steps to reproduce
Use this code:
Titanium.UI.setBackgroundColor('#000');
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
title : 'Table with Search'
});
var tab1 = Titanium.UI.createTab({
title : 'Table w/ Search',
window : win1
});
var allNoteTypes = [{
title : 'Plan 1'
}, {
title : 'Plan 2'
}, {
title : 'Plan 3'
}];
var searchBar = Ti.UI.createSearchBar({
barColor : "#283D5A"
});
var table = Ti.UI.createTableView({
top : 0,
width : "100%",
backgroundColor : 'transparent',
hideSearchOnSelection : false,
data : allNoteTypes,
search : searchBar
});
win1.add(table);
tabGroup.addTab(tab1);
tabGroup.open();
There are two ways to replicate:
1) focus the bar, write something, then rotate the screen
2) focus the bar, write something and press return in the virtual keyboard
Note
Not sure if this can be considered related: the CANCEL button also stops working when the device is rotated. With the same code, focus the bar and rotate the screen: the CANCEL button stops working.
The feature only come back when the app is restarted (e.g. rotating the device back does not help).
[~dcassenti] Does this relate to TIMOB-15281?
Pull pending against master https://github.com/appcelerator/titanium_mobile/pull/4717
Test Case with ListView and TableView
Backport to 3_1_X https://github.com/appcelerator/titanium_mobile/pull/4722
SearchBar stays when it has text and rotated. Verified fix on: Device : iPhone 5 , iOS version : 7.0 SDK: 3.2.0.v20131013140318 CLI version : 3.2.0 OS : MAC OSX 10.8.4 Alloy : 1.2.2 Appcelerator Studio, build: 3.2.0.201310112258 XCode : 5