change image of imageView

You must Login before you can answer or comment on any questions.

Hi,

I got a probleme on changing url property of an imageView in an event:

var row = Titanium.UI.createTableViewRow({
        hasCheck: false
    });
    row.decline = '0';
    row.flag = Titanium.UI.createImageView({
        url: '/images/uncheck.png',
        width: 20,
        height: 20,
        left: 2,
        top: 2.5
    });
 
 
    row.add(row.flag);
    row.addEventListener('click', function(e){
        var row = e.row;        
        if (row.decline == '0') {
            row.decline = '1';
            row.flag.url = '/images/check.png';        }
 
        else 
            if (row.decline == '1') {
                row.decline = '0';
                row.flag.url = '/images/uncheck.png';
            }
    });
 
    data.push(row);
When i click on the row, i got this trace:
[TRACE] W/TiUIImageView( 5556): (main) [12121,21624] The url property of ImageView is deprecated, use image instead.
[TRACE] W/TiUIImageView( 5556): (main) [7,21631] The url property of ImageView is deprecated, use image instead.
[TRACE] W/TiUIImageView( 5556): (main) [85,21716] The url property of ImageView is deprecated, use image instead.

1 Answer

Thats not actually an error - its a warning. Just like the compiler spat out (which is also in the Appcelerator Titanium API reference), the .url property of imageView controls is depreciated. You should replace all the .url properties with .image (for imageViews).

Your Answer

Think you can help? Login to answer this question!