Created
May 3, 2011 19:26
-
-
Save gbtrabzon/954030 to your computer and use it in GitHub Desktop.
CoverFieldView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var images = []; | |
for (var i = 1; i < 15; i++) { | |
images[i] = 'images/markalarim/'+ i +'.png'; | |
} | |
// create coverflow view with images | |
var view = Titanium.UI.createCoverFlowView({ | |
images: images, | |
top:20, | |
bottom: 0 | |
}); | |
win.add(view); | |
// click listener - when image is clicked | |
view.addEventListener('click',function(e) { | |
// the window to place the image in | |
var imgWindow = Ti.UI.createWindow({ | |
modal: true, | |
barColor: '#050505', | |
backgroundColor: '#050505' | |
}); | |
// The new image view to place the selected image | |
var fullImage = Ti.UI.createWebView({ | |
html: '<img src="images/markalarim/markalarim.png" />' | |
}); | |
// Create a button to close the modal window | |
var close_modal = Titanium.UI.createButton({title:'Kapat'}); | |
imgWindow.rightNavButton = close_modal; | |
// Handle close_modal event | |
close_modal.addEventListener('click', function() { | |
imgWindow.close(); | |
}); | |
// Add the views to the window and open it | |
imgWindow.add(fullImage); | |
imgWindow.open(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment