iPhone SDK: Freezing part of a webview - iphone

I was wondering if there was a way to freeze a certain section of a webview so that when you scroll through the webview that part of the webview still shows instead of hiding. For example, When having facebook in a webview how could it be possible to keep the blue bar with the notifications, messages, and friend request to always stay on the top when scrolling down the webview just like it is done in the facebook app?

If you want a element inside the webview stays pinned on the screen without affected by the scrolling, you may try to apply position:fixed CSS style on that DOM element.
Please note that position:fixed is not supported before iOS5.
And the native scroll bouncing effect of the UIWebView also affects the fixed position DOM element so you may determine if you also need to disable that bouncing effect.

Related

Flutter: How to embed multiple horizontally Webviews in PageView

I am prototyping an Epub reader in Flutter. Each chapter is displayed in a WebView and these WebViews are placed inside a PageView. The contents of each WebView is paginated thanks to a multi-column layout: 1 column = 1 visible page.
During a horizontal swipe gesture, the expected behavior is to have the WebView's contents scrolling while possible, and then have the PageView scrolling between pages as soon as the WebView has reached its limit. Note: during 1 swipe gesture, both can happen: WebView scrolling first, then the PageView.
On Android, it's easily handled thanks to overscroll notifications, as in This code.
But in Flutter, the WebViews are not scrollable and we cannot use the OverscrollNotifications (AFAIK). So I have a few working solutions based on injecting JS code inside the WebView to broadcast the scroll position to the Flutter side, but this is very dirty and frustrating, I hate this kind of code...
Does anyone have a good solution? Thanks a lot in advance!
EDIT: I have a new idea based on Javascript. Instead of continuously sending scroll notifications to the Flutter side during scrolling, I will insert transparent pixels at the beginning and end of each "chapter", and send events to Flutter only when these elements become visible/invisible (thanks to the IntersectionObserver API). But such a solution requires injecting stuff into the chapter's HTML, which is not the best solution. Any better idea is still welcome!

Material-ui v0 Safari iOS dialog content scroll

Safari mobile.
If i scroll sidebar, it is doing very quickly. But if I try scroll Dialog content, it is doing very slow and sometimes scroll background instead..
I wrote video, where you can find that effect.
https://yadi.sk/i/VXgqHfW83YbbN3
Does any solutions for this situation?
To make the Dialog content scroll normally on iOS, you have to add -webkit-overflow-scrolling: touch; to the CSS.
The background scrolling when you don't want it to is a bit of a harder problem, but you can find some more information here: iOS - css/js - Overlay scroll but prevent body scroll

Enabling dragging functionality for images within a scrollable div for Web Apps

There are images with some text in a div that contains native scroll bar. I want to make those images dragable keep allowing native scrolling to be functional on that div. Sliding fast on images shouldn't fire drag events, like what iOS home screen does. I'm looking to do this in iPad and iPhone with iOS6.1 for now.
Any suggestion and jQuery plugin will be helpful!

Scroll Iframe on IPhone

I have a web app that wraps the main site content in an Iframe to enable some elements that are persistent across the site (only way to do what I'm after as far as I can tell).
It works fine on most browsers, but there is a scrolling problem on the Iphone: The content displays, but trying to scroll does a drag and drop operation instead.
Is there any way to tell the Iphone browser to use normal scrolling in that specific Iframe?
Example site: http://carlocapocasa.com
Thanks a ton and a half,
Carlo
Use two fingers to scroll up and down.
I also had problems getting an iframe to scroll on iOS devices. My iframe was inside a DIV, which had it's overflow set to hidden.
My solution was to set the overflow of the containing DIV to visible.

UIWebView scrolls jerkily

I need to use a website with quite a bit of content in my App via UIWebView.
When I scroll the page in Mobile Safari everything scrolls smoothly. Even if I scroll fast - the grey squared background appears but is rendered properly after a few moments (less then 0.5 seconds).
The same page in UIWebView scrolls jerkily if scrolled fast and doesn't show the grey squared background.
I guess Mobile Safari shows the grey squared background first and renders after that while UIWebview stops the scrolling until the part which will be shown is rendered.
How to I tell UIWebView to behave like Mobile Safari?
It is already being drawn on it's own custom tiledLayer. The problem is that it is by default attempting to draw itself on the main thread so it locks up when I can't be drawn. There is a private message you can call
-(void)_setDrawInWebThread:(BOOL)arg1
That will work BUT you will see empty space when you scroll too fast and it can't keep up with the drawing until it has time to catch up. They use:
-(void)_setDrawsCheckededPattern:(BOOL)arg1
in mobile safari to help with this.
Found a better solution. CGTiledLayer.
http://developer.apple.com/mac/library/documentation/GraphicsImaging/Reference/CATiledLayer_class/Introduction/Introduction.html