XcodeでscrollViewを作成してセットアップすると、機能しません。スクロールしてコンテンツが表示されないだけです。私はそれのバックエンドをコーディングしましたが、行きません!私はiOS4からこのチュートリアルを使用しています:DevxScrollviewチュートリアル
さて、新しいiPhoneの新しい画面サイズのために、iOS6では壊れていると思います。これが私が使用しているバックエンドコードです:
scrollView.frame = CGRectMake(0, 0, 320, 520);
//---set the content size of the scroll view---
[scrollView setContentSize:CGSizeMake(320, 520)];
// Do any additional setup after loading the view.
Xcodeのスクロールビューのサイズは、幅:320、高さ:520です。
私は何が間違っているのですか?それはおそらく愚かなことです。
アップデート:
- (void)viewDidLoad
{
[super viewDidLoad];
[self.overlay removeFromSuperview];
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
[nc addObserver:self selector:@selector(keyboardWillShow:) name:
UIKeyboardWillShowNotification object:nil];
[nc addObserver:self selector:@selector(keyboardWillHide:) name:
UIKeyboardWillHideNotification object:nil];
tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
action:@selector(didTapAnywhere:)];
[self customizeAppearance];
self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"stone.png"]];
[scrollView setScrollEnabled:YES];
scrollView.frame = ([UIScreen mainScreen].bounds);
//---set the content size of the scroll view---
[scrollView setContentSize:CGSizeMake(320, 800)];
// Do any additional setup after loading the view.
}