Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12328] iOS: search bar layout issues when setting 'width' property

GitHub Issuen/a
TypeBug
PriorityLow
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 2.1.4, Release 3.0.2, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterFederico Casali
AssigneeUnknown
Created2013-01-17T16:58:01.000+0000
Updated2018-02-28T20:03:25.000+0000

Description

Problem description

When setting 'width' property for the search bar on top of a TableView, the search bar is then being wrongly displayed.

Steps to reproduce

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();

Attachments

FileDateSize
Screen Shot 2013-01-17 at 4.57.59 PM.png2013-01-17T16:58:01.000+000049254

Comments

  1. jithinpv 2013-03-22

    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

JSON Source