Note that there are some explanatory texts on larger screens.

plurals
  1. POClick event doesn't working when click on Titanium ImageView
    primarykey
    data
    text
    <p>I am working on a mobile web apps for iphone. Where I got data from a web-service. Problem is my image view is not working for click event. I have no idea about the reason... Please help... I post my code bellow...</p> <pre><code> Titanium.include('commonFile.js'); var win = Ti.UI.currentWindow; var url = carsDetailUrl + nid; var imageArea = Titanium.UI.createView({ width : 300, top: 50, height : 125, borderRadius : 6 }); var image1 = Ti.UI.createImageView({ image : "", left : '8dp', top : '10dp', width : 135, height : 106, touchEnabled : 'true', borderColor : '#000000', borderRadius : 6, borderWidth : 1, }); var completeScrollView = Ti.UI.createScrollView({ top : '0dp', left : '0dp', contentWidth : 320, touchEnabled : 'true', borderRadius : 10, backgroundImage : '../images/bg.png', showHorizontalScrollIndicator : false, showVerticalScrollIndicator : false, //height : '300dp' }); var xhr = Ti.Network.createHTTPClient({ onload : function() { var tableData = []; var headLines, imageLabel, i, row, viewDetail, cars, images; cars = JSON.parse(this.responseText); headLines = cars.data[1]; images = cars.data[1]['image']; var mainScrollView = Ti.UI.createScrollView({ top : '0dp', left : '0dp', contentWidth : 320, touchEnabled : 'true', borderRadius : 10, backgroundImage : '../images/bg.png', showHorizontalScrollIndicator : false, showVerticalScrollIndicator : false, }); var viewDetail = Ti.UI.createView({ top : '10dp', left : '10dp', height : 'auto', width : '94%', touchEnabled : 'true', borderRadius : 10, backgroundColor : '#FFFFFF', }); image1.image = encodeURI(images[1]); /*var image1 = Ti.UI.createImageView({ image : encodeURI(images[1]), left : '8dp', top : '10dp', width : 135, height : 106, touchEnabled : 'true', borderColor : '#000000', borderRadius : 6, borderWidth : 1, });*/ var image2 = Ti.UI.createImageView({ image : encodeURI(images[2]), left : '150dp', top : '11dp', width : '70dp', height : '50dp', borderColor : '#000000', borderRadius : 3, borderWidth : 1, }); viewDetail.add(imageArea); imageArea.add(image1); imageArea.add(image2); mainScrollView.add(viewDetail); mainScrollView.add(view2nd); completeScrollView.add(mainScrollView); win.add(completeScrollView); }, onerror : function(e) { alert('There was an error retrieving the remote data. Please check your internet cunnectivity.'); }, timeout : 45000 }); xhr.open("GET", url); xhr.send(); image1.addEventListener('click', function(evt) { Ti.API.info("image clicked"); var newWin = Ti.UI.createWindow({ url : '../automobileSubClass/carImageGallery.js', title : nTitle, tabBarHidden : true, barColor : '#000000', //navBarHidden : true, backgroundImage : "../images/bg.png" }); Titanium.UI.currentTab.open(newWin, { animated : true }); }); </code></pre> <p>But if I create a Button to go to that url and then the button click working... But I need to click working when user click on the image... Please help. Thanks..</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload