i am developing one application.In that i am using UIScroll view.That will be scrolled vertically when i perform the touch operations on that scroll view.But i need to perform that top scroll and bottom scroll operations using top and bottom buttons.So please tell me how to perform this scrolling operation using that buttons.
As the others have said, this is not really recommended. However, it is possible...
For the "Top" button, use this code:
[scrollView scrollRectToVisible:CGRectMake(0, 0, 320, 20) animated:YES];
Use a similar approach for the "Bottom" button, taking into account the height of your scroll view.
Rather than putting Buttons and adding scrolling functionality on those button, Just flash right / left indicator images using animation to user,so that user can come to know there is more content than current page.
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've seen iOS apps that allow users to scroll around a view that is larger than the screen itself, without seeming to implement a UIScrollView mechanic. So for example, the actual image displayed on the screen is double the width of the screen, and the user can pan left and right to view all the content. Is this just a case of making the ViewController's width twice that of the screen and allowing some kind of panning via gesture recognizers? With what I'm trying to do, it seems like this would be easier that implementing a UIScrollView...
Implementing scrollview is much easier than handling pan gesture, when Apple has given built-in functionality then why you do not want to use it?
You can either use UIPangestureRecognizer or UIscrollview. The Latter option is very simple.
In my app, I have part of a view sticking out from the right. I would like the user to be able to swipe that to the left, to pull/reveal the rest of that view, which would basically almost cover the screen. See below:
I am figuring my best option is to use UIScrollView for two reasons. That I can lock the movement to horizontal only, and the animation for swiping is already built it.
My question is, can I have one page of the UIScrollView smaller than the other as shown in my mockup images?
UIScrollView horizontal paging like Mobile Safari tabs
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];
How to show a small pop up on click of button on a view that will be displayed in small region of the parent view.
You can simply define the frame for your view, and add it as a subview of its parent.
newView.frame = CGRectMake(60, 140, 200, 200);
[parentView addSubview:newView];
Just putting up a view is pretty straightforward (create a UIView, position it, then addSubview it to the parent). But there are a few UI design questions you may want to ask yourself before you pop something up. Things like:
Is the pop-up modal? Once it's up can the user do something else or do they have to 'dismiss' the view before continuing.
How does the user dismiss the view? Do they tap the view itself, some sort of 'close' object, or tap outside of it?
Where do you position the pop-up view if you're too close to the side of the window (otherwise it gets clipped and the user can't see all of it).
Should you offset it from the button itself so the tapping finger isn't covering up the item? How many pixels work best? And does the offsetting bring the view too close to the edge, so maybe show it on the other side so it's not clipped?
And they say UI design is easy ;-)