Implementing page-flip-type animations in UIWebView on the iPhone - iphone

I'm using UIWebView on the iPhone to display EPUB content, but I'd like to simulate the page flipping 'experience' (display an animation of the page folding over) and then scrolling the content in my UIWebView down by the area of one screen -- effectively turning a page in reflowable non-paginated content. Should I stop dreaming, or would this be possible?

What about making a copy of the UIWebView, scrolling it to the appropriate position, and then using the page flip transition to go from view to view, then deallocating the first UIWebView?

Related

How to show vertical or horizontal scroller on UIWebView?

I ma using UIWebView to some html content. And some time the data is more in width or height but I have fixed size UIWebView. So for user perspective I want to show scroller vertical or horizontal to indicate the user that there are some more content are available in this view. I am using
[webView.scrollView flashScrollIndicators];
but it show scroller when I touch UIWebView. I want to show scroller by default. Can you suggest how to do this.
Use the scroll view of the webviw like this:
[(YOUR WEBVIEW).scrollView setShowsHorizontalScrollIndicator:YES];
[(YOUR WEBVIEW)scrollView setShowsVerticalScrollIndicator:YES];
You can do one thing that ,use this
- (void) webViewDidFinishLoad:(UIWebView *)webView){
[(YOUR WEBVIEW).scrollView flashScrollIndicators];
}
It Will show the scroll-indicator when downloading of the content will finish and user will easily understand that , there are more content on the bottom of the page.
The answer here is simple - you can't as it is against the human interface guidelines. There is a reason that the only way you can manually get them to show is by calling flashScrollIndicators. Apple didn't intend for you to show them so if you're going to implement this, it's going to be the hard way (subclassing or creating your own UIWebView).
Appearance and Behavior
When a scroll view first appears—or when users interact with it—vertical or horizontal scroll indicators flash briefly to show users that there is more content they can reveal. Other than the transient scroll indicators, a scroll view has no predefined appearance.
A scroll view responds to the speed and direction of gestures to reveal content in a way that feels natural to people. When users drag content in a scroll view, the content follows the touch; when users flick content, the scroll view reveals the content quickly and stops scrolling when the user touches the screen or when the end of the content is reached. A scroll view can also operate in paging mode, in which each drag or flick gesture reveals one app-defined page of content.
Source - iOS UI Element Usage Guidelines

Mobile Safari like scrolling of UIWebView (with navigationbar stuck at top)

How would I go about making a browser window that has the same scrolling properties as Mobile Safari? If you scroll Mobile Safari the navigationbar up top follows with it. If there is no more content it stops scrolling, and it has a very special way of zooming. Mobile Safari has it, and now even Opera mini for iPhone has it. Any ideas? I have tried hooking in to the scrolldelegate of the UIWebView, but that's not perfect at all. I'm out of ideas. How have the Opera Mini guys solved this issue?
I haven't done this myself but it seems to me that you could create a holder view that has your a view handling the navigation and the UIWebView, this would be tucked into a UIScrollView to facilitate the scrolling and then in the UIScrollView delegate pass the UIWebView as the view for zooming in viewForZoomingInScrolView.

How do I change the scrolling distance of a UIView to be like Safari app

I want to have a UIScrollView that scrolls less then the full screen so that it looks like the Safari app does when you go to make a new tab or look at all the tabs. What property would this be?
When viewing "tabs" in Mobile Safari each tab is a UIWebView placed in a paged UIScrollView. When you "zoom out" to switch between them a CGAffineTransform to reduce the scale of the web view is being applied.

How to get transition like Star Trek app?

I've modified the ViewTransitions app to use kCAScrollHorizontally. I've set transition in the app delegate to use kCATransitionPush rather than kCATransitionFade. However, I still get fading in and out. How can I get the views to slide in landscape just like the Star Trek app (http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=305916616&mt=8)?
I've done transitions like this before. Basically I have a big view that takes up the screen, with another view (the actual screen content) embedded within it. When I want to slide in a new page either from the left or right, I'll take the next page of content, place it offscreen, and embed it in the big backing view. Then I'll just animate (using a simple [UIView beginAnimations:context:] to change the frames of both pages simultaneously (really just changing the origins of the frames). The offscreen view slides to where the current view is, and the current view slides to an offscreen position. Once offscreen, I'll remove it from its superview. Works like a charm.
The simulator will still fade out rather than performing some complex transitions...
Did you try it on the device?

UIWebView within a ScrollView does not redraw

I have UIWebView within a UIScrollView. Then as I scroll, the web view displays first two pages correctly but does draws only half of the third the page. If I tap on the web view it draws the content or if I call -[UIWebView reload] in -scrollViewDidEndDecelerating, it shows the content.
Is there any way I can make the web view draw correctly?
UIWebViews cannot be loaded concurrently. You must load one, wait til it finishes, then load the next, and so on.
You can do this on a timer, or wait until when the scrolled UIWebView has the focus before loading the data.
All UIViews have a size limit of 1024x1024 pixels. This is stated at the end of the Overview section of the UIView documentation.
If your web view must have more than 1024px of content, you will have to take it out of the parent scroll view and let it manage scrolling on its own.