Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16070] Android: TableView and SearchBar used together cause height: Ti.UI.SIZE to be ignored

GitHub Issuen/a
TypeBug
Priorityn/a
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 3.2.0
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, height, searchbar, tableview, ti.ui.height
ReporterJoe Webster
AssigneeUnknown
Created2013-10-23T19:59:40.000+0000
Updated2018-02-28T20:04:26.000+0000

Description

TableView behaves like the height property is set to Ti.UI.FILL - even if set to Ti.UI.SIZE when a searchBar is added via the search property. In the screen shot, you can see the result of toggling the search property on or off for the tableView. The table has no data/rows attached. With no search property set, the window background (white) is visible. When toggling it on, the table view with the red background fills the screen. Initially posted here: http://developer.appcelerator.com/question/158544/android-searchbar-and-tableview-height-issue-with-tiuisize
 
var win = Ti.UI.createWindow({
    backgroundColor:'#fff'
});
 
var searchBar = Ti.UI.createSearchBar({
    top      : 0,
    width    : Ti.UI.FILL,
    height   : 43,
    barColor : '#FFF',
    hintText : 'Search'
});
var searchTable = Ti.UI.createTableView({
    //search  : searchBar,
    top     : 0,
    width   : Ti.UI.FILL,
    height  : Ti.UI.SIZE,
    backgroundColor: '#ff0000',       
});
 
win.add(searchTable);
win.open();

Attachments

FileDateSize
debug-tableview-searchbar.jpg2013-10-23T19:59:40.000+000020345

Comments

  1. Mostafizur Rahman 2013-12-15

    Tested this issue with the code below and was able to reproduce this on Android simulator and device.

    Test Environment

    Android SDK: 2.3.3 Ti SDK: 3.1.3 GA and 3.2.0 GA SDK Ti CLI: 3.2.0-cr3

    Test Code

       
       var win = Ti.UI.createWindow({
           backgroundColor:'#fff',
           layout:'vertical'
       });
          
       var searchBar = Ti.UI.createSearchBar({
           top      : 0,
           width    : Ti.UI.FILL,
           height   : Ti.UI.SIZE,
           barColor : '#FFF',
           hintText : 'Search'
       });
       
       var searchTable = Ti.UI.createTableView({
           search  : searchBar,
           top     : 10,
           width   : Ti.UI.FILL,
           height  : Ti.UI.SIZE,
           backgroundColor: '#ff0000',       
       });
       searchTable.appendRow({title:'table row',backgroundColor:'transparent',color:'#fff'});
          
       win.add(searchTable);
       win.open();
       
       

    Step to reproduce

    Create a simple code with test code

    Run this in Android Device

    Table View color change when search property is used

  2. Ritu Agrawal 2013-12-23

    We can reproduce this issue with 3.2.0.GA SDK. Table View height property behaves differently when search property is used. Moving this to engineering for further evaluation.

JSON Source