How to implement a zoomable UIPageViewController when in Two Pages mode? - ios

I need to implement a zoomable UIPageViewController in iOS 5 when in a two pages layout mode (in other words, when the Spine Location is set to Mid).
Using a scrollview for each page works fine when only one page is displayed. But when two pages are diplayed side-by-side in landscape mode, how can one seamless synch the pages and align the borders during the zoom animation?
One possible solution would be to put the UIPageViewController inside a bigger UIScrollView controller, but this yelds a blurred image because the two scrollviews inside the pages are not updated with a higer resolution area of the source images when the parent is zoomed.
It seems that is impossible to zoom inside a UIPageViewController when in two page mode. Is there someone who found a solution to this?
Thanks in advance.

I am still testing, but I have this.
I used the pageviewcontroller template.
I changed the scene to show a image instead a month (inside a UIImageView).
used a UIPinchGestureRecognizer to zoom the image and an UIPanGestureRecognizer to move the image once it is zoomed and it works.
The only problem is sometimes the page swipe is recognised instead the pan, so it changes the page instead moving the inside image.
And it only zooms a page at a time, I marked clip subviews in the view of the dataViewController, so 2 pages remains the same size even when you zoom in the other.

Related

Free Scrolling in Xcode 8.3.3

I want to create a page with a big image as background and buttons that users can interact with.
So imagine I put a big image such as a piece of map into the screen, but I only show a corner of the map in the display. So if a user wants to see other parts of the map, they have to "scroll" and navigate to wherever they want.
Meanwhile I also want to put a button they can tap on, and that button should lead to a php webpage (in-app, not opening in safari or else) or information page about sites and buildings in this location.
I am a rookie and I haven't have any code written down yet. I am thinking about using UIScrollView and UIButton, but am I on the right direction? Any advice?
Thanks in advance!
First you need a way to pinch zoom the image. In this mode, you can drag the image in any direction that you want. A common method can be found here. A scroll view can only scroll horizontally or vertically but with that image zooming, each image can be zoomed in and then dragged to any direction you want. You can have a scroll view with only one image.
After you have the image zooming ready, all you need to do is to create a subview on your screen to cover part of the image view or scroll view, whatever you used.

How to slideshow of ppt in iOS webView?

I am developing an iOS application to slideshow and even manually move slides of ppts(one slide at one time)upon a webview(in both portrait and landscape)using objective C.I have created buttons to move slides one by one forward and backward(one slide to appear at a time).Also,two separate buttons for autosliding and selecting animation types with which the slide show has to appear.I am using 'setContentOffset' method to move slides from one to another.
More importantly I need only one slide to appear in webview at a time and hence i have set the webview's frame size approximately to the height of a slide by merely observing with respect to the view controller's size.
The problem arising is in 'calculating the height of a single slide' and 'the variation in the webview's frame in different iPhones and iPads'.This slide height is further used to calculate the total number of slides in the ppt by dividing the content size of webview's scroll view by a slide's height.Since I am unable to calculate a slide's height exactly,I am ending with inaccuracy in moving slides one by one.Every time when 'setContentOffset' is called slide is moving by different amounts.
Please any one guide me in developing slideshow of ppt in webview with exactly one slide appearing at a time and this application must be supported in both portrait and landscape modes and with all iPhones and iPads.
Thanks in advance
This is the reference of the same for image view apply the same logic with slight modification in your case https://github.com/adamwulf/PowerPointToUIImage
hope this will help you !

Outbounds Image Pieces in PageCurl Transition on UIPageViewController

I have an application in which I have implemented the system transitions between views UIPageViewController offers. The problem I have is that in each view images placed indicating the Frame where they have to be affixed. If this frame outside the screen, when I make the transition to pass page, the pieces of the images protruding frames page are shown. I know the best way for do this is edit the image erasing this piece, but the problem is that this images with I have the problem, are dynamically set in place for each size of screen
The best way to this is setting view.clipsToBounds = true.

MWPhotoBrowser - Images moving inside view

I am sure this is an easy question, but I am lost. I have MWPhotoBrowser and a bunch of photos loaded into the browser. Everything works beautifully, except if I click on an image in the browser and drag it around the screen it moves everywhere and repositions the image. Essentially I just want to stop if from dragging around all together.
Any recommendations ?
There were two issues causing this problem:
Autolayout was turned off. Since I wanted it to remain off I had to create a work around with #2.
The content appears to be sized to the View. In my case the view height was much larger than the available display area on the screen. To work around the issue I used another view sized to the viewable area and added the browser to that view rather than the super view.

Pan and Pinch a UIImageView within a ScrollView

I have created a small app using a ScrollView w/ paging and a series of UIImageViews each representing a page. It acts similar to the Photos.app.
I want to be able to pan and zoom individually for each image (page of a scrollview).
What would be the most sound approach to do this? Should I replace the UIImageView page with a scrollview with a UIImage inside it? I would then have a main scroll view where each page of the scrollview had a scrollview with an image inside it that could be pinched,etc.
It seems like a messy approach. I am looking for a clean approach. Any suggestions?
Well, as far as I know the approach you suggest is the way it is done. I have used this to create a PDF viewer and once everything is in place it doesn't feel too messy.
You might want to use CATiledLayer as your inner (per-page) scrollview's layer (instead of CALayer) if these images you have are really big (which could well be the case since otherwise zooming in on them would not bring you much but pixelation, but this is just an assumption on my part).
Checkout UIPageViewController. This controller manages a view controllers for each page and transitions between them using effects like page curl or scroll.
In your case you would create a view controller that manages a scrollview for zoom & pan for each page.

Resources