hi i am new to iphone.I need to scroll scrollview horizontally instead of vertical.Is it possible to scroll horizontally.If it possible pls post link consist sample example.Thank u in advance.
Asked
Active
Viewed 1,018 times
3 Answers
2
you can use following code
[myscrollview addSubview:imgButton];
x = frame.origin.x; y = frame.origin.y+80;
[myscrollview setContentSize:CGSizeMake(x,y)];
in that each time you add a new button/Image increase content size Y position and also make set scroll vertical false.
EDIT: Here is the link to your question.
-
pls post some sample example link – Mahesh Babu Sep 22 '10 at 11:11
1
It's hard to answer you without a concrete example. In general, the scrolling directions of a UIScrollView are defined by it's "contentSize" property. So if you have a label (myLabel) which is wider than your scrollView (myScrollview) you could write this:
myScrollview.contentSize = CGSizeMake(myLabel.frame.size.width, myScrollview.frame.size.height);
//Next line is rather optional, should be already set by default
myScrollview.scrollEnabled = YES;

Philipp Schlösser
- 5,179
- 2
- 38
- 52
0
If you want an example, here the sample codes are. As Phlibbo said, the contentSize of scrollView will decide the direction of that.

AechoLiu
- 17,522
- 9
- 100
- 118