Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var win = Ti.UI.createWindow({});
- var view = Ti.UI.createView({});
- var button = Ti.UI.createButton({
- color : '#000000',
- title : "Add photo",
- height : 'auto',
- width : 'auto'
- });
- view.add(button);
- button.addEventListener('click', function(e) {
- showCamera();
- });
- function showCamera() {
- Titanium.Media.showCamera({
- showControls : true,
- mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
- autorotate : true,
- success : function(event) {
- },
- error : function(error) {
- },
- cancel : function() {
- }
- });
- }
- win.add(view);
- win.open();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement