Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

addEventListener 'click' not working sometimes ?

$
0
0

Hey,

I have the following code:

var startButton = Titanium.UI.createButton({
    width: 180,
    height: 50,
    bottom: 0,
    backgroundColor: '#32CD32'
});
 
startButton.addEventListener("click", function cameraButtonClick (cam) {
    Ti.Media.takePicture();
});
 
var myOverlay = Titanium.UI.createView();
myOverlay.add(startButton);
Sometimes when I run the app, everything works, and sometimes the app doesn't recognize the click... What can cause this issue ?

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>