Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-4532

iPhone: Unable to scroll TableView until click SearchBar

    Details

      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.

      app.js

          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

        Attachments

          Activity

            People

            • Assignee:
              stephentramer Stephen Tramer
              Reporter:
              mvizcaino Miguel Vizcaino
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-3868
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration