How to slideshow of ppt in iOS webView? - ios

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 !

Related

Can't scroll in my iOS application

I'm pretty new in creating iOS applications and currently I'm following Apple's starter tutorial.
They suggest simulating on iPhone 6 which has a pretty big screen and therefore all the content fit its screen, however I'm simulating on iPhone 4 which has a smaller screen. All the content don't fit and I can't see all of the placeholder image. I'd expect that I would automatically be able to scroll so I'm able to view all the content but no.
It seems that you have designed your contents on normal view. Instead you have to use UIScrollView which will allow you to scroll to see all your contents. contentSize property is important for this.
Refer Here: https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScrollView_Class/
The UIScrollView class provides support for displaying content that is
larger than the size of the application’s window. It enables users to
scroll within that content by making swiping gestures, and to zoom in
and back from portions of the content by making pinching gestures.

Creating an animation such as iOS 8 Weather App

I want to create a view in which I like to have animation such as the one present in iOS 8 Weather app.
I try to explain more what I have done. If anything is incorrect please guide me.
In the top I put a label for the temperature. (The big one)
Below that label, I put another label to show some text. In the Weather app, there is the horizontal scrollview showing the hourly forecast.
Next is the Table view.
What I want to achieve is that when I start scrolling, the first label disappear smoothly and the second one go to top of the screen and the TableView stretches to show more content.
When I scroll back to the top, I want the whole process to revert.
What is the best way to do this?
I've recently re-created the iOS8 Weather app's scrolling effect for an app I'm creating.
The complete code is too long to post here but for anyone who's interested, I've put it on GitHub. You can download and run the project to see how it looks. Improvements to the code are welcome:
UIScrollView with masked content.
It works like this:
You have one scrollview (the size of the screen), which contains a subview (the mask) which in turn has a subview (the content). We also add a large label to the top of the screen (in the Weather app, this displays the temperature).
Then you use the scrollViewDidScroll delegate method to keep the mask fixed to the screen as the user scrolls. You also use this method to stretch the mask upwards at first.
Fixing the mask to the screen means that the mask's subviews (our content) also becomes fixed. But we want it to scroll, so we do the opposite to the content of what we did to the mask (again, using scrollViewDidScroll).
We need the mask to actually behave as a mask, so we set clipsToBounds = YES on the mask.
Finally, we use the scrollview's offset during scroll to move and fade the big label at the top of the screen.
To make it behave exactly like the iOS8 Weather app, we need to also do the following:
Cancel any scroll touches that happen above the mask, i.e. over the large temperature display.
Ensure that the initial scroll that moves the temperature display is completed programatically if the user doesn't complete it.
Add a sideways-scrolling subview which is anchored to the top of the mask.
I haven't done these yet, though.

Manipulating scroll view in Corona SDK

I have a class with a scroll view that has a width of 980. I also have about 100 buttons aligned 5 columns x 5 rows for each 320 width of my scroll view. The scroll works okay but I'm trying to achieve two things:
Allow scrolling only when slide length is about 50% of screen size
If the slide length is half the screen size, then it would immediately slide/scroll to the next 25 items. For example, in plain sight you would see buttons 1-25 then if you try to scroll, the next 25 objects would be displayed (buttons 26-50).
I followed the sample from here but I don't know how to implement what I want to do or if it's even possible to do this using scroll view. I hope someone can give me a good example or idea. Thanks.
Try something like this: http://developer.coronalabs.com/code/slider-module-springboard-functionality-warning-shameless-promotion-inside. It works sort of like the iOS springboard.

UIPageViewController rotation weirdness

I've added a UIPageViewController to my app to act as a manual for the app. When the user pops it up it shows one page in portrait and two in landscape with the spine in the middle. Since I have about 100 pages, there is a sibling view UICollectionView page selector view above it to allow jumping to a page quickly. Both the UIPageViewController and the UICollectionView sit on a backing view that contains them both.
The problem I am having with the UIPageViewController is that when the views are first rotated they seem to constrain themselves to the short dimension of the original layout. So, if it first appears in portrait, then when rotating to landscape the width of the two pages is the same as the old portrait width. Likewise, if it first appears landscape with two pages, rotating to portrait has the correct width, but the height is the height of the initial landscape height. This is consistent on any device.
When I create my content views they are all the size I desire, but for some reason they seem to be transformed by some component of UIPageViewController and I'm not grasping why it is only doing one of the two dimensions and why it is always the "short side" that is the problem.
This is one of those kinds of problem that makes me feel a bit nutty, any ideas on how I might debug it if it isn't some trivial misconfiguration?
I finally found it after a long period of debugging. The critical hint was seeing that the spine is set to the correct mid for the width of the view BEFORE the rotation for portrait to landscape. The solution was to reset the frame of the view to the new size given the orientation in willAnimateRotationToInterfaceOrientation.
I calculate the new size before I call an animation block that uses the duration passed into the method, then inside the block I have:
pageViewController.view.frame = newFrame;
When the page is rotated the view holding the content pages is shifted to the correct size and the spine is place correctly and the content fills the given area. I suppose that I ran into the problem because the complexity of the views required me to take over so many defaults, but this one was left hanging.

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

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.

Resources