Пример #1
0
	view.addEventListener("setimage", function(e){
		Ti.API.info( JSON.stringify( e) ); // this is interesting since having the console.log out actually makes the function perform as it should.
		
		// lets ensure we are using the calling source to prevent memory leaks
		IMAGE.setImage(e.source, e.image, e.source.width, e.source.height, e.source.scaletofit);
		
	});
Пример #2
0
exports.createImageView = function(args) {
	// first lets remove the image since we are using it at as backgroundImage of a view;
	var image = args.image;
	var behaviour = args.scaletofit;
	
	delete args.image;

	// Lets stage the context
	var view = Ti.UI.createView( args );
	
	view.addEventListener( "postlayout", _getLaid );
	
	if ( image ) {
		IMAGE.setImage(view, image, args.width, args.height, behaviour);
	}
	
	// Public Methods for accessing Module
	view.addEventListener("setimage", function(e){
		Ti.API.info( JSON.stringify( e) ); // this is interesting since having the console.log out actually makes the function perform as it should.
		
		// lets ensure we are using the calling source to prevent memory leaks
		IMAGE.setImage(e.source, e.image, e.source.width, e.source.height, e.source.scaletofit);
		
	});
	
	return view;
};