2012-02-08 11 views
0

次のコードにUIScrollViewを追加しようとしていますが、txtファイルの内容が含まれていると少し不安です。これについていくつかの助けを感謝します。感謝:)あなたにプログラムでuiscrollviewを追加します

#import "AboutController.h" 


@implementation AboutController 

- (NSString *)textForView 
{ 
    NSString *path = [[NSBundle mainBundle] pathForResource:@"about" ofType:@"txt"]; 
    NSError *error; 
    return [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error]; 
} 

#pragma mark - View lifecycle 

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib. 
- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 
    [self showLogoInNavBar:YES]; 
} 

- (void)viewDidUnload 
{ 
    [super viewDidUnload]; 
    // Release any retained subviews of the main view. 
    // e.g. self.myOutlet = nil; 
} 

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{ 
    // Return YES for supported orientations 
    return (interfaceOrientation == UIInterfaceOrientationPortrait); 
} 

@end 
+1

a)何が起こると予想されているのか、b)実際に何が起こっているのか、そしてc)問題を解決するために何をしたのか説明してください。これはそれほど大きな問題ではありません。 –

+0

私は単純なページをスクロールできるようにしたい。現時点では内容はスクロールできません。ありがとう – CraigBellamy

答えて

0

:助け

- (void)loadView 
{ 
    CGRect scrollViewFrame = CGRectMake(0, 0, 320, 460); 
    UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:scrollViewFrame]; 
    [self.view addSubview:scrollView]; 
    CGSize scrollViewContentSize = CGSizeMake(640, 460); 
    [scrollView setContentSize:scrollViewContentSize]; 
} 

希望!!

+0

それは何もしないようです.. :( – CraigBellamy

+0

hmmm ...あなたが試みたコードを投稿することはできますか? – iProRage

関連する問題