0
這是我迄今爲止,我有一個滾動和兩個按鈕,我想在滾動,但我不能得到第二個按鈕,因爲它不會滾動到它。如果有人能看到我的代碼中的錯誤,我將不勝感激。UIScrollView沒有正確滾動
UIScrollView *mainScroll = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 65, 320, 4000)];
mainScroll.contentSize = CGSizeMake(320, 4000);
mainScroll.showsHorizontalScrollIndicator = YES;
[self.view addSubview:mainScroll];
[mainScroll setScrollEnabled:YES];
UIButton *mainCreateGame = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[mainCreateGame addTarget:self
action:@selector(goToCreateGameViewController)
forControlEvents:UIControlEventTouchUpInside];
[mainScroll addSubview:mainCreateGame];
mainCreateGame.frame = CGRectMake(75, 10, 170, 60);
UIButton *anotherButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[anotherButton addTarget:self
action:@selector(goFuckOffApple)
forControlEvents:UIControlEventTouchUpInside];
[mainScroll addSubview: anotherButton];
anotherButton.frame = CGRectMake(75, 3000, 170, 60);
大聲笑...我對這點有點生氣。哈哈哈哈,謝謝一個男人。 =) – nfoggia 2012-04-22 02:35:09
沒問題。我仍然在笑的方法名稱... – CodaFi 2012-04-22 02:35:45
哈哈哈我不認爲他們會接受我的應用程序大聲笑 – nfoggia 2012-04-22 03:29:28