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

Event Listener on Overlay View Element

$
0
0

I have a gallery script based on the flexigrid widget. On iOS its working like charm but on android the event listener on the overlay is not fired when tapping an image. Even if only add the overlay into the grid.

Any suggestions?

for (var x = 0; x < data.length; x++) {
 
        var frame = Ti.UI.createView({
            width : columnWidth,
            height : columnWidth,
            backgroundColor : options.gridColor || '#eee',
            top : 0,
            left : 0,
            right : space,
            bottom : space,
            id: 'frame_'+x
        });
 
        var overlay = Ti.UI.createView({
            width : Ti.UI.FILL,
            height : Ti.UI.FILL,
            backgroundColor : '#000',
            zIndex : 9999,
            strImage : data[x].largeImage,
            page: x,
            id: 'overlay_'+x
        });
 
        var gridElement = Widget.createController('gallery', {
            image : data[x].image,
            title : data[x].title,
            width : columnWidth,
            padding : options.padding || 10,
            showTitle : options.showTitle || false
        }).getView();
 
        Ti.API.info("Bind image", data[x].image);
 
        overlay.addEventListener('click', function(e) {
            Ti.API.info("Show image", e.source.strImage);
            exports.openModal(e.source.strImage, data, e.source.page);
        });
 
        //frame.add(gridElement);
        frame.add(overlay);
 
        $.fgScrollView.add(frame);
    };

Viewing all articles
Browse latest Browse all 8068

Trending Articles



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