I am using Three20's TTscrollview for pdf display. It's work fine for horizontal swipe.Now I need vertical scrolling not horizontal. So how to do that anybody know about do this vertical scrolling with TTScrollview.
Thanks
It depends on how you set the contentSize of the scrollView. If the contentSize is set for one direction larger than the scrollView's frame then you should be able to scroll to that direction. So, play with the contentSize and see if it works.
Related
I updated xcode to 4.5 but now when I make à UIScrollview it stops scrolling as soon I place something in the scroll like à label or button, when I remove them the scrolls works again
someone knows the fix?
Code
My ScrollView is 320 by 430 and in my viewdidload I use:
[scroller setScrollEnabled:YES];
[scroller setContentSize:CGSizeMake(320, 481)];
edit
I just discovered that in landscape mode it does scroll so maybe I am setting my content size wrong? :S
edit#2
It works now if I make a text view in the scrollview and make the text larger then the screen, but When I place a button into it the button doesnt scroll along ..
Extra
I made a video showing What I do hope someone can tell me what im doing wrong
http://www.youtube.com/watch?v=rzYTWLiIC8g&feature=youtu.be
"Use Autolayout" was on it has to be off and it will be fixed thanks for all your support.
You don't have enough content for scrolling.
Please add more content text. Then only it scroll.
Set the contentSize of your scroll view to the size of the content, eg. if you have 10 rows of buttons, each row's height let's say 40px, and padding 5px, the height (height if you are putting the content vertically, width if horizontally) of the contentSize of the scroll view is: 10*45.0f+5.0f. If this doesn't help, then show us your code.
Thanks in advance. In my project am using paging and scrolling. but when i scrolling one page to another page we can able to scroll in horizontal, vertical and diagonally but i want to scroll only in horizontal direction only. Any one can suggest me.
It will scroll vertically if you have its content size height set to more than actual height of scrollview height..
To remove vertical scrolling do this.
scrollview.contentSize = CGSizeMake(YourWidth,scrollview.frame.size.height);
you can also set
scrollview.bounces = NO ;
to remvoe Bouncing.
Set the contentSize of UIScrollView such that the width of the contenSize is always equal to the width of the UIScrollView. Just vary the height of contentSize.
Goto to Xib->Select the Scrollview and Disable the Vertical Scrolling property in Xib file
Disable vertical scrolling and set proper height (max is the height of the scrollview) for subviews in all the pages...
I am trying to create something like this (look at the time), you can basically slide it horizontally.
Can anyone give me any suggestions on how to do this in iOS?
You'd use UIScrollView which you can constrain to just horizontal movement. The Scrolling demo may help to get you started.
It is pretty easy:
create a scrollview with frame of (xOrigin,yOrigin,SCREEN WIDTH,Height).
set the content size to (CONTENT WIDTH, Height).
setShowsHorizontolScrollIndicator to no to hide the scroll indicator.
Note: Width of the contentSize property should be greater than the frame width to make it horizontally scrollable.
I have a UIScrollView that has a single child view within it. If I set the contentSize of the UIScrollView immediately after creation, everything works as I expect and I get scrolling.
The challenge is the view within the UIScrollView is dynamically sized. The width is fixed, but the height is unknown at the time I set up the scrollview.
When I do a [scrollView setContentSize:CGRectMake(...)] after the inner view does it's thing, the scrollview updates to the proper size and scrolling works. So basic scrolling works fine.
However, the major problem is that when I setContentSize at a later point, the UIScrollView decides to scroll down(with animation) towards the end of the scrollview, which is not what I want, I want the scroll to stay at the top, and let the contents within the scrollview either get bigger or smaller, without changing the apparent scroll position.
What am I missing?
Why don't you also call [scrollview setContentOffset:CGPointMake(0,0)]; when you call the setContentSize?
To force UIScrollView to scroll only e.g. horizontally, I always set non-scrollable value for contentSize to 0, using:
CGSizeMake(contentSize.width, 0).
Is it possible to do vertical scrolling without horizontal scrolling in UIScrollView? How can I do this?
The property pageEnabled should set to TRUE, for paging scroll.
The contentSize's width is as the same as view's width, and the height of contentSize set the value you desired. Then, it will do vertical scrolling, but no horizontal scrolling in UIScrollView.
You can read this sample coes, ScrollViewSuite. Maybe there are something you need in the sample codes.