When setting 'width' property for the search bar on top of a TableView, the search bar is then being wrongly displayed.
Create a Search Bar and set the width property value.
Result: Search Bar is not longer correctly displayed (see screenshot).
Setting 'width' value should not have effect on Search Bar size.
Note that setting also the right property, in this case the Search Bar is also always displayed below the right Index (see TIMOB-666)
Search Bar resize issues also reported in TIMOB-11676
var win = Ti.UI.createWindow({
title:'Test win',
backgroundColor:'white',
// modal:true // setting to true and displaying the Tile Bar, the Search Bar is correctly displayed
});
// create table view data object
var data = [
{title:'Alan (click to change index)', hasChild:true, header:'A'},
{title:'Alice', hasDetail:true},
{title:'Alexander'},
{title:'Amos'},
{title:'Alonzo'},
{title:'Brad', header:'B'},
{title:'Brent'},
{title:'Billy'},
{title:'Brenda'},
{title:'Callie', header:'C'},
{title:'Cassie'},
{title:'Chris'},
{title:'Cameron'},
{title:'Don', header:'D'},
{title:'Dilbert'},
{title:'Deacon'},
{title:'Devin'},
{title:'Darin'},
{title:'Darcy'},
];
var search = Titanium.UI.createSearchBar({
width:200,
// right:0
});
// create table view
var tableview = Titanium.UI.createTableView({
data:data,
search:search
});
// create table view event listener
tableview.addEventListener('click', function(e)
{
if (e.index === 0){
tableview.index = index2;
}
// event data
var index = e.index;
var section = e.section;
var row = e.row;
var rowdata = e.rowData;
Titanium.UI.createAlertDialog({title:'Table View',message:'row ' + row + ' index ' + index + ' section ' + section + ' row data ' + rowdata}).show();
});
// set filters
var index = [
{title:'A',index:0},
{title:'B',index:5},
{title:'C',index:9},
{title:'D',index:13},
{title:'E',index:19},
{title:'F',index:23},
{title:'G',index:27},
{title:'H',index:30},
{title:'I',index:33},
{title:'J',index:36},
{title:'K',index:41},
{title:'L',index:44},
{title:'M',index:48},
{title:'N',index:52},
{title:'O',index:55},
{title:'P',index:(data.length -1)}
];
tableview.index = index;
// add table view to the window
win.add(tableview);
win.open();
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 (03/11/13 15:43 0c88429) Titanium SDK version: 3.0.2 (02/07/13 16:46 a4def81) iOS iPhone Simulator: iOS SDK version: 6.0 jithinpv