How can we identify that a user has zoomed the webView so as to resize the other components present. My webView starts from the middle of the screen and when a user zooms the webView it starts to scroll horizontally and vertically but it happens within the webView.The scrolling happens internally. I want to lock the webView from scrolling internally so that when a user scrolls vertically, the labels,textfields etc. on top of the webView also scroll up and not the webView alone. What I want to achieve is pretty similar to iPhone Native Email Client. For accomplishing this, I would like to put this webView on top of a scrollView and when a user zooms it, I would like to reset the content size of my scrollView so that whatever is added to the scrollView like labels and textfields above the webView also scroll when I scroll the webView.
Any ideas?
You could do:
Disallow user to pinch zoom the webview
Detect double tap on your scrollview and toggle webview's scalesPageToFit property AND set userInteractionDisabled on webview
Now you can scroll only scrollview which has all the controls..
You can find help from this
Disabling default zoom effect
and
scalesPageToFit property
Related
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
I am trying to zoom a scroll box which is similar to the one here
http://www.quackit.com/html/codes/html_scroll_box.cfm
in a UIWebview.
Assume that I have set the above page as URL for my UIWebview. can I zoom inside the scrollbox ? I am able to zoom the entire webpage by setting the scalesPagesToFit = YES.
I tried setting the delegate of UIwebview subviews which are UIScrollViews to self and returning self.webview in viewForZoomingInScrollView. But I am not able to achieve it.
Is it possible to zoom a scroll Box or a scroll area in HTML page in UIWebview ?
I achieved zooming by handling the mouse move event in Javascript file and I am scaling the appropriate DIV. Now, the problem is that, I am not able to scroll the scaled content horizontally. My HTML page has position: fixed in CSS and I changed that to relative and tried giving overflow:auto and scroll. , overflow-x as scroll. But still the issue is not resolved
I have displaying image thumbnails in a UIScrollView, if user taps on a thumbnail, the application should open that image. if, however, user drags on a thumb, the scroll view should pan. Right now the scrollview only scrolls if user is able to drag on the small empty space between the thumbnails. the subviews (the one's displaying image thumbs) use a UITapGestureRecognizer to detect taps, and exclusiveTouch on subviews is set to NO, UIScrollView has its canCancelContentTouches set to false.
Try leaving canCancelContentTouches set to YES, that allows the scroll view to override its subviews if it seems the user is trying to scroll.
I've a UIWebview displaying a .rtf file. The lines of text are wider than the screen.
1) Is there a way to get the text to wrap around rather than going off the edge of the screen and requiring the user to scroll.
2) Is there a way to disable horizontal scrolling in the UIWebView.
Many Thanks
Code
If you want the content to fit inside the view, set it's scalesPagesToFit property to true:
webView.scalesPagesToFit = YES;
If you do that, the pages shouldn't be horizontally scrollable. If they are, you can fiddle around with the stuff in UIScrollView Reference because UIWebView is a subclass of it.
I have a modal view with a textview and a button. When the keyboard is displayed it covers up some of my UI elements. I'd like my modal to be scrollable so that it can be viewed while the keyboard is displayed. How can I do this?
I've had the same question, and i've played with it a bit,
setting a UIScrollView is not enough, as in the inspector
you should 1st. increase it Hight, then in the attributes, check the following checkboxes:
Scrolling enabled, Bounce Scroll, always bounce vertically.
Edited: Forgot the most inportant thing:
in the size inspector, set the Buttom field (under content) to the size you wish, (960 is twice the regular size)
Use a UIScrollView instead of an ordinary UIView. You can disable scrolling when you don't want the user to be able to with:
[theView setScrollEnabled:NO];