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

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.

Related

iPhone Google Chrome - Tab selection screen (Grouped UIViews)

I am working on an app for iOS and I have to do a tab selection screen like the Google Chrome app for iPhone (I attached a screenshot). I searched a lot but I didn't found any similar control to use. As i can see, it groups some UIViews and use a UIScrollView to scroll, but maybe any of you could explain me better how this control works or have any solution.
Thank you!
http://i.stack.imgur.com/rCG5g.png
Create Different UIViews with your controls.(One tab is equal to is on UIView)
Add this UIView's on UIScroll View.(This is optional. It's ok if you don't use the UIScrollView and add UIView on self.view
Implement the touch method on UIView.
When you get a particular UIView is touched change it's center position to Center of the screen.
Which will give you the UIView which is touched in foreground and rest of the Views in background.
Hope this will help you .........
I solved my problem with this ......
https://github.com/xxhp/BrowserTabViewDemo

Force iphones and ipads into landscape mode via a web based layout

Is there a way to force ipads and iphones to render the web based layout in landscape mode only?
You have to prevent the view from rotating with:
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return NO;
}
then you have to initiate the view in landscape this way you will prevent the view from rotating.
You can't force Safari to stay in a specific orientation, but you can detect it.
body[orient="landscape"] or body[orient="portrait"] can be used in your CSS to render two different layouts. If you choose, one of them (portrait in this case) can display a "not optimized for this layout" screen of some sort.
I suppose you could try to do a -webkit-transform: rotate(-90deg) on the body of the page, but if the page scrolls that probably would not be feasible. If your layout was exactly the right size, though, it might look pretty close to correct.

UIWebView never displays scroll bar

I have a UIWebView displaying content of multiple pages in length.
The problem is this: a scroll bar never appears while the user is scrolling the content vertically (unlike in Safari, or in other apps using what appears to be UIWebView). I can't see any way to control this programmatically.
Behaviour is the same on iOS 3.1 through 4.2, on both iPhone and iPad, both device and simulator.
Anyone have any ideas?
Are you sure the WebView is not slightly bigger than its parent? If it's a bit too big the scroll bars might actually be there but off the screen.
[(UIScrollView*)[webview.subviews objectAtIndex:0] setShowsVerticalScrollIndicator:YES];

Implementing page-flip-type animations in UIWebView on the 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?

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.