开发者

Image scroller problem

开发者 https://www.devze.com 2023-02-21 17:39 出处:网络
hello every budd开发者_Python百科y i want to make horizontal image scroller at bottom view and in the back of side big Image View. i don\'t know how to make image horizontal scroll.Place the image vie

hello every budd开发者_Python百科y i want to make horizontal image scroller at bottom view and in the back of side big Image View. i don't know how to make image horizontal scroll.


Place the image view inside a scroll view whose horizontal content size is greater than its frame width, i.e.

UIScrollView *scrollView = [[UIScrollView alloc] init];
scrollView.frame = CGRectMake(0, 0, 100, 100);
scrollView.contentSize = CGSizeMake(300, 100);
[scrollView addSubview:imageView];


You should use contentSize property of the UIScrollView to set its content size according to your requirement and then set the property showsHorizontalScrollIndicator to YES and showsVerticalScrollIndicator to NO . But you don't require to set these two if you set frame and content size properly. Like if _myScrollView.frame.height and _myScrollView.contentSize.height is same then you don't need to set horizontal and vertical scroll. Its vertical scroll will automatically be disabled.


you can use scroll view with page control for a horizontal slideshow. follow the tutorial it might help you

http://www.edumobile.org/iphone/iphone-programming-tutorials/pagecontrol-example-in-iphone/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号