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

iOS: Ti.UI.Switch disappears when scrolling TableView

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: Release 3.4.0
    • Component/s: iOS
    • Labels:
    • Environment:

      Tested on:
      Ti SDK 3.0.2GA
      iOS Simulator 6.0

      bug also seen in:
      IOS: 6.1.2/6.1.3.
      Titanium SDK: 3.0.0GA

      Description

      Problem
      When quickly scrolling down a tableview the switches, in this case the topmost switch, inside the rows, disappears.

      You have to scroll back very slow to make them appear again.

      Steps to Reproduce
      1. Use Ti SDK 3.0.0 or 3.0.2
      2. Copy and paste provided code in app.js
      3. Run on iOS simulator 6.0 or 6.1
      4. Scroll down quickly so that the switches moves off the screen (at the top)
      5. Repeat step 4 until the top switch disappears on return to viewing all 3 switches
      6. Slowly scroll upwards from bottom most position in order to for switch to reappear

      var rnav = Ti.UI.createButton({
          backgroundImage: "img/nav/close.png",
          width: 40,
          height: 31
      });
       
      rnav.addEventListener("click", function(){
          title: "click"
      });
       
      wNav = Ti.UI.createWindow({
          navBarHidden: true
      });
       
      var w = Ti.UI.createWindow({
          backgroundColor:'#fff',
          rightNavButton: rnav,
          backgroundColor: "#e1e1e1"
      });
       
      var s0 = Ti.UI.createTableViewSection({
          headerTitle: "Perfil"
      });
       
      var s01 = Ti.UI.createTableViewSection({
          headerTitle: "Notificações"
      });
       
      var s1 = Ti.UI.createTableViewSection({
          headerTitle: "Sobre"
      });
       
      var s2 = Ti.UI.createTableViewSection();
       
      var profileChange = Ti.UI.createTableViewRow({
          title: L("Meu Perfil"),
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      s0.add(profileChange);
       
      var passChange = Ti.UI.createTableViewRow({
          title: L("Mudar Senha"),
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      s0.add(passChange);
       
      var notifPush = Ti.UI.createTableViewRow({
          title: "Push notifications",
          backgroundColor: "#fff",
          height: 43
      });
       
      var pushSwitch = Titanium.UI.createSwitch({
          value: 1,
          right: 15
      }, function(){
          chparams();
      });
       
      notifPush.add(pushSwitch);
       
      var soundPush = Ti.UI.createTableViewRow({
          title: "Som de alerta",
          backgroundColor: "#fff",
          height: 43
      });
       
      var soundPushSwitch = Titanium.UI.createSwitch({
          value: 1,
          right: 15
      });
       
      soundPush.add(soundPushSwitch);
       
      var notifMail = Ti.UI.createTableViewRow({
          title: "Email",
          backgroundColor: "#fff",
          height: 43
      });
       
      var mailSwitch =  Titanium.UI.createSwitch({
          value: 1,
          right: 15
      });
       
      notifMail.add(mailSwitch);
       
      s01.add(notifPush);
      s01.add(soundPush);
      s01.add(notifMail);
       
      var aboutFeedback = Ti.UI.createTableViewRow({
          title: "Feedback",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      var aboutTell = Ti.UI.createTableViewRow({
          title: "Chame seus amigos!",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      var aboutFAQ = Ti.UI.createTableViewRow({
          title: "Perguntas & Respostas (FAQ)",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      var aboutTerms = Ti.UI.createTableViewRow({
          title: "Termos & Condições de Uso",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      var aboutPrivacy = Ti.UI.createTableViewRow({
          title: "Política de Privacidade",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      var aboutUs = Ti.UI.createTableViewRow({
          title: "About",
          hasChild: true,
          backgroundColor: "#fff"
      });
       
      s1.add(aboutFeedback);
      s1.add(aboutTell);
      s1.add(aboutFAQ);
      s1.add(aboutTerms);
      s1.add(aboutPrivacy);
      s1.add(aboutUs);
          
      var logout = Ti.UI.createTableViewRow({
          //backgroundImage: "img/dashboard/signout.png",
          backgroundColor: "#fff",
          height: 43,
          width: 302,
          selectionStyle: Ti.UI.iPhone.TableViewCellSelectionStyle.NONE
      });
      s2.add(logout); 
          
      var tableView = Ti.UI.createTableView({
          backgroundColor: "transparent",
          separatorColor: "#666",
          style: Ti.UI.iPhone.TableViewStyle.GROUPED,
          data: [s0,s01,s1,s2]
      });
       
      w.add(tableView);
       
      w.open();
      

      Expected Result
      Switch does not disappear when scrolled down

      Actual Result
      On occasion, switch disappears when scrolled down and switch is out of sight

      Notes: This seems to only be an issue when there are switches within tableViewSections and this only occurs when tableView is large enough such that on scroll, the switches are not visible on screen. When tested without extra rows and switches are constantly in view, I could not reproduce the bug.

        Attachments

          Activity

            People

            • Assignee:
              penrique Pedro Enrique (Inactive)
              Reporter:
              clathrop Carter Lathrop
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code