Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-4532] iPhone: Unable to scroll TableView until click SearchBar

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-10-27T14:52:58.000+0000
Affected Version/sRelease 1.7.0, Release 1.7.1
Fix Version/sSprint 2011-27, Release 1.8.0
ComponentsiOS
Labelsscroll, searchHidden, searchbar, tableview
ReporterMiguel Vizcaino
AssigneeStephen Tramer
Created2011-06-30T11:43:45.000+0000
Updated2011-10-27T14:52:58.000+0000

Description

Bug

If you set "searchHidden" to true, you can scroll perfectly the TableView. But if you set it to false, you are unable to scroll until you click the SearchBar.
    Titanium.UI.setBackgroundColor('#000');
     
    var tabGroup = Titanium.UI.createTabGroup();
     
    var win1 = Titanium.UI.createWindow({  
        title:'Tab 1',
        backgroundColor:'#fff'
    });
    win1.addEventListener('focus', function(){
		tableview.searchHidden = false;
		Ti.API.info("tableView = false");
    });
     
    var tab1 = Titanium.UI.createTab({  
        icon:'KS_nav_views.png',
        title:'Tab 1',
        window:win1
    });
     
    var searchBar = Ti.UI.createSearchBar({
    	cancel:false
    });
     
    var tableview = Ti.UI.createTableView({
            search: searchBar,
            scrollable:true,
            data:[ { title:'dog'}, { title:"cat"}, { title:"bird"},
            	   { title:'frog'}, { title:"turtle"}, { title:"lizard"},
            	   { title:'hamster'}, { title:"snake"}, 
            	   { title:'shark'}, { title:"elephant"}, { title:"mouse"},
            	   { title:'lion'}, { title:"gorilla"}, { title:"eagle"},
            	   { title:'fish'}, { title:"squirrel"} ]
    });
    tableview.addEventListener("click", function(e) {
		alert("Index " + e.index + " \n" + e.rowData.title);
    });
    
    var scrollView = Titanium.UI.createScrollView({
	    top:0,
    	contentHeight:0,
	    showVerticalScrollIndicator:true
	});
	
    scrollView.add(tableview);
    win1.add(scrollView);
     
    var win2 = Titanium.UI.createWindow({  
        title:'Tab 2',
        backgroundColor:'#fff'
    });
    win2.addEventListener('focus', function(){
		tableview.searchHidden = true;
		Ti.API.info("tableView = true");
    });
     
    var tab2 = Titanium.UI.createTab({  
        icon:'KS_nav_ui.png',
        title:'Tab 2',
        window:win2
    });
     
    var label2 = Titanium.UI.createLabel({
            color:'#999',
            text:'I am Window 2',
            font:{fontSize:20,fontFamily:'Helvetica Neue'},
            textAlign:'center',
            width:'auto'
    });
     
    win2.add(label2);

    tabGroup.addTab(tab1);  
    tabGroup.addTab(tab2);  
     
    tabGroup.open();

Associated Helpdesk Ticket

http://support.appcelerator.com/tickets/APP-426287

Comments

  1. Stephen Tramer 2011-07-06

    Resolving issue as the pull has been accepted.
  2. Alan Vaghti 2011-08-29

    Passed as expected on: iPod 3rd Gen 4.0.2 iPad 2 4.3.2 iPhone 4 4.2.10 SDK: version=1.8.0 timestamp=08/26/11 14:53 githash=8e978eb...

JSON Source