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

Android: ImageView: Images are not rendered correctly if the url is not valid

    Details

      Description

      Steps to reproduce:
      1. Run the test code. Row 2, Row 4 and Row 8 have no images.
      2. Scroll up and down the list view.
      Expect result: Row 2, Row 4 and Row 8 should always have no images.
      Actual result: Row 2, Row 4 and Row 8 have random images showing.

      var win = Ti.UI.createWindow({
      	backgroundColor : 'white'
      })
       
      var listContainer = Ti.UI.createView({
      	height : '90%'
      })
       
      win.add(listContainer);
      win.open();
       
      //Basic List View, default template
      //Checking to see how height is being set
      var listView = Ti.UI.createListView({
      	defaultItemTemplate : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT
      })
      //Both header and footer
      var listSection1 = Ti.UI.createListSection({
      	headerTitle : 'HEADER1',
      	footerTitle : 'FOOTER1'
      })
      listSection1.setItems(getDataDefaultTemplate());
      //Only header
      var listSection2 = Ti.UI.createListSection({
      	headerTitle : 'HEADER2',
      })
      //Only footer
      var listSection3 = Ti.UI.createListSection({
      	footerTitle : 'FOOTER3'
      })
      //Neither
      var listSection4 = Ti.UI.createListSection({
      })
       
      if (Ti.Platform.osname == 'android') {
      	listSection2.setItems(getDataDefaultTemplate());
      	listSection3.setItems(getDataDefaultTemplate());
      	listSection4.setItems(getDataDefaultTemplate());
      }
      listView.setSections([listSection1, listSection2, listSection3, listSection4]);
      listContainer.add(listView);
       
      function getDataDefaultTemplate() {
      	var data = [];
      	var titleStr = '';
       
      	for ( i = 0; i < 10; i++) {
      		titleStr += 'title ';
      		var mod = i % 4;
      		var cellh = 50;
      		var acType = Ti.UI.LIST_ACCESSORY_TYPE_NONE;
      		var ci = 'KS_nav_ui.png';
      		if (mod == 1) {
      			acType = Ti.UI.LIST_ACCESSORY_TYPE_CHECKMARK;
      			cellh = 70;
      			ci = 'KS_nav_views.png';
      		} else if (mod == 2) {
      			acType = Ti.UI.LIST_ACCESSORY_TYPE_DETAIL;
      			ci = 'junk';
      			cellh = 90;
      		} else if (mod == 3) {
      			acType = Ti.UI.LIST_ACCESSORY_TYPE_DISCLOSURE;
      			cellh = 110;
      			ci = 'http://www.catravelservices.com/management/hotels/pictures/Mawamba_lodge_nature.jpg';
      		}
      		var item = {
      			template : Ti.UI.LIST_ITEM_TEMPLATE_DEFAULT,
      			properties : {
      				title : titleStr + i,
      				image : ci,
      				accessoryType : acType,
      				itemId : 'Item ' + i + ' ' + acType,
      				height : cellh
      			}
      		}
      		data.push(item)
      	}
      	return data;
      }
      

        Attachments

          Activity

            People

            • Assignee:
              pwang Ping Wang
              Reporter:
              pwang Ping Wang
              Reviewer:
              Allen Yeung
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration