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.
+1
A:
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;
Phlibbo
2010-09-22 10:48:42
i did n't get it pls post any link consist sample example on it
MaheshBabu
2010-09-22 11:09:13
it is good idea.it works fine
MaheshBabu
2010-09-23 09:21:29
+1
A:
hi
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.
iPhone Fun
2010-09-22 10:52:41
A:
If you want an example, here the sample codes are. As Phlibbo said, the contentSize of scrollView will decide the direction of that.
Toro
2010-09-22 12:15:31