Friday, January 20, 2012

Share button in Image Gallery

We recently added a new property to the SD Image Gallery user control: Enable Share Action.

This property adds a button to the user interface that lets you select several images, and send them by e-mail.

Note: by now this feature is only available in the iOS generator (starting on build 52470, see the night builds log), but it will be added to Android and BlackBerry soon...

But before using this property, we need to have an image gallery... To do that, simply select the Grid item in the layout that you want to show as an image gallery, and set the Control Type to "SD Image Gallery". You also need to set the property Data Attribute with an image attribute that will be displayed in the user control.


If you want your users to be able to share the images by e-mail, just set the property Enable Share Action to True (default is False).

This is how it looks when you run the application in the iPhone:


The "Share" button is located on the upper right corner of the screen. When you tap it, it changes to "Done", and lets you select one or more images.


When you tap "Done", an e-mail composer window appears with the selected images attached.


That's it: as easy as setting a property in your control :)

If instead of being in the gallery view (where you see several thumbnails) you already selected an image, the "Share" button shows the e-mail composer window with that image attached.


No comments:

Post a Comment