我想添加一個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
請你解釋一下a)你期望發生什麼,b)實際發生了什麼,c)你已經做了什麼來解決這個問題?這不是一個問題。 – 2012-02-08 01:04:37
我希望能夠滾動頁面,簡單。目前內容不可滾動。謝謝 – CraigBellamy 2012-02-08 01:14:38