If imageview image='XXX.png' remove other view

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

Hi, I would like to remove the play view if the album imageview image is avatar.jpg How can I do that? I tried this:

var album = Ti.UI.createImageView({
        image:e.row.album,
        site:e.row.music,
        height:200,
        width:200,
        left:5,
        top:5,
        });
        fourth.add(album);
 
if (album.image = 'avatar.jpg'){
play.remove();
}
 
      var play = Ti.UI.createImageView({
        image:'playbtn.png',
        height:100,
        width:100,
        left:55,
        top:50,
        });
        fourth.add(play);

1 Answer

Accepted Answer

First, you can't remove play if play hasn't been added yet. Second, if you want to remove play, you have to remove it from the same element you've added it to. So if you added it via fourth.add(play), then you remove it with fourth.remove(play);

Your Answer

Think you can help? Login to answer this question!