0
"변경"이벤트를 기반으로 이미지 뷰를 새로운 이미지로 변경하려고합니다. . 내가 현재 코드와이 이벤트를 시도 할 때, 나는 오류 - "잘못된 이미지 유형을 얻을 TiBlob 또는 TiFile 중 하나를 예상했다 : NSNull에서 - [TiUIImageView setImage_ : (TiUIImageView.m : 693)티타늄 - 피커를 사용하여 이미지 뷰 변경
//This label contains text that will change with each picker change
var results = Titanium.UI.createLabel({
text:"Select from the picker below",
height:40,
width:"auto",
top:20
});
//This view contains an image that will change with each picker change
var imageView = Titanium.UI.createImageView({
image:"images/logos/CIK.jpg",
height: 100,
width: 100,
left: 110,
top: 80
});
picker.addEventListener("change", function(e){
results.text = e.row.title + ": Home of the " + e.row.val;
imageView.image = e.row.logo; //logo contains a value like images/logos/BURRTON.jpg
});
win.add(results);
win.add(imageView);
win.open();
이가 쉽게 할 수 있어야한다,하지만 난 난처한 상황에 빠진 것 같다. 어떤 도움에 감사드립니다. 당신이 대신`backgroundImage`을 설정하려고하면 대신 imageView
의
설정 이미지? –
backgroundImage도 변경되지 않았습니다. URL도 사용했습니다. –
이미지 경로가 올바른지 또는 e.row.logo가 올바른 경로를 표시하는지 알 수 없습니다. 그러나 더 많이 시도 할 수있는 한 가지는'imageView' 대신'View'를 사용하고'backgroundImage'를 설정 한 다음 어떤 일이 일어나는가를 보는 것입니다. –