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

Android: Change image property of imageView doesn't work in tableviewRow

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: Release 3.0.2
    • Component/s: Android
    • Labels:
    • Environment:

      Ti SDK 3.0.0GA
      Android 2.x & 4.x
      iOS 6
      OSx 10.8.2

      Description

      Problem

      When imageView in TableViewRow and Android, setImage doesn't work (just work 1st time).

      Tested on

      iOS 6 simulator
      Razr Droid OS 2.3.5

      To reproduce

      run below example, click row multiple times.

      Snippet code

       
      var win = Ti.UI.createWindow({
      backgroundColor : 'white'
      });
       
      var table = Ti.UI.createTableView();
      var row = Ti.UI.createTableViewRow({
          height : 100
      });
      var img = Ti.UI.createImageView({
          width : 100,
          height : 100
      });
       
      row.add(img);
      table.data = [row];
      win.add(table);
      win.open();
       
      var srcs = [
          "http://t3.gstatic.com/images?q=tbn:ANd9GcQUkHHr21JB_gUXFHFVe-uXFEG2M3D25Vy6DWaifLf_1pZkwwfGkg",
          "http://t0.gstatic.com/images?q=tbn:ANd9GcQ2hy-N72tStiinhPW1qUPT3kduibk-e5ufAeZtq3NI9GPRsLCl",
          "http://t2.gstatic.com/images?q=tbn:ANd9GcSZLz8YqLQYatlgtRIR8qQ0Dl6tD1AoR1NYby8zJbBln1oX55UE",
          "http://t3.gstatic.com/images?q=tbn:ANd9GcTSZ7Rg1kzKjqtvf06-aDgQHCvE7SKB6uh_JIdfy_e4Jj-cPuiy"
      ];
       
      var index=0;
      table.addEventListener('click',function(e){ 
          var src = srcs[(index++)%4];
          Ti.API.info(src);
          img.setImage(src); //doesn't work! (just work 1st setImage)
          //img.setBackgroundImage(src); //work!
      });
      

      Additional info
      • When imageView in window, setImage work every time.

       
      var win = Ti.UI.createWindow({
      backgroundColor : 'white'
      });
       
      var img = Ti.UI.createImageView({
          width : 100,
          height : 100
      });
      win.add(img);
      win.open();
       
      var srcs = [
          "http://t3.gstatic.com/images?q=tbn:ANd9GcQUkHHr21JB_gUXFHFVe-uXFEG2M3D25Vy6DWaifLf_1pZkwwfGkg",
          "http://t0.gstatic.com/images?q=tbn:ANd9GcQ2hy-N72tStiinhPW1qUPT3kduibk-e5ufAeZtq3NI9GPRsLCl",
          "http://t2.gstatic.com/images?q=tbn:ANd9GcSZLz8YqLQYatlgtRIR8qQ0Dl6tD1AoR1NYby8zJbBln1oX55UE",
          "http://t3.gstatic.com/images?q=tbn:ANd9GcTSZ7Rg1kzKjqtvf06-aDgQHCvE7SKB6uh_JIdfy_e4Jj-cPuiy"
      ];
       
      var index=0;
      win.addEventListener('click',function(e){ 
          var src = srcs[(index++)%4];
          Ti.API.info(src);
         img.setImage(src);
      });
      

        Attachments

          Activity

            People

            • Assignee:
              jithinv@exalture.com jithinpv
              Reporter:
              yomybaby Jong Eun Lee
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code