MasterRazer
MasterRazer

Reputation: 1377

How to display ImageView in fullscreen?

I want to display a image ,which is displayed in an ImageView, in fullscreensize if the user touches a button or the image itself. Is there a way to do this? I've seen similar on Facebook application. I want to display the image size the screen in portrait mode and when the orientation was changed in landscape mode I want that the image fits the screen. Is there a way to do this maybe a sample code? And how can the user exit the fullscreen mode? Maybe this is possible with a subvie, but I dont know how to treat that.

Here is what I mean:

Portrait mode:

enter image description here

Landscape mode: enter image description here

And the close Button. The comment section is not needed. enter image description here

I would be happy if someone could help me with this.

Best regards.

Upvotes: 1

Views: 3484

Answers (2)

RemeR
RemeR

Reputation: 667

You could use the pod XLMediaZoom to show images and videos in fullscreen like Instagram. See this answer: https://stackoverflow.com/a/18282163/1070393

Upvotes: 0

vishy
vishy

Reputation: 3231

The description you gave it is similar to the photo gallery app in the iOS, which has zoom scroll and many more functions.

Check out this open source sample.

Created by Michael Waterfall, which includes photo gallery from images stored on server or locally.

You can modify the code as per your project requirements. And it is easy to handle the images. This will suit your need.

Edit: You can handle the classes in this way, you can see in the sample code it has 2 classes MWPhotoBrowser which is a photo browser a viewController. And a MWPhoto used to represent the photo objects.

You need to maintain photos list in MWPhoto formats only, so while using you can have a tableView showing all the photos in thumbnail in grid view style and on tapping any image your code should open that image in MWPhotoBrowser means your photos array will be same same just start index you need to change.

Upvotes: 1

Related Questions