我想在屏幕底部做無限滾動。我做了什麼是 我已經創建了8個按鈕,並且必須使它滾動無限(Button7 - > Button0 - > Button1之後。 ..)。我不知道下一步該做什麼。 這是我所做的代碼。底部UIScrollView無限滾動ios
- (void)viewDidLoad
{
[super viewDidLoad];
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 450, self.view.frame.size.width, 35)];
int x = 0;
for (int i = 0; i < 8; i++) {
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(x, 0, 100, 20)];
[button setTitle:[NSString stringWithFormat:@"Button %d", i] forState:UIControlStateNormal];
button.backgroundColor=[UIColor blackColor];
[scrollView addSubview:button];
x += button.frame.size.width;
}
scrollView.contentSize = CGSizeMake(x, scrollView.frame.size.height);
scrollView.backgroundColor = [UIColor redColor];
[self.view addSubview:scrollView];
}
https://developer.apple.com/library/ios/samplecode/StreetScroller/Introduction/Intro.html和http://stackoverflow.com/questions/19268456/how-can- i-make-uiscrollview-infinite-in-ios – iPatel