以下代碼片段顯示在正確的背景上,但文本不滾動。UITextView不滾動,需要幫助
我在想什麼?
-(void) viewWillAppear:(BOOL)animated {
UITextView *scrollableText = [[UITextView alloc] initWithFrame:CGRectMake(20, 20, 300, 800)];
[scrollableText setOpaque:TRUE];
[scrollableText setBackgroundColor:[UIColor clearColor]];
[scrollableText setEditable:NO];
[scrollableText setText:@"some really really long text"];
[scrollableText setScrollEnabled:YES];
UIImage *backgroundImage = [[UIImage alloc] initWithCGImage:[UIImage imageNamed:@"about_bg.png"].CGImage];
UIImageView *backgroundView = [[UIImageView alloc] initWithImage:backgroundImage];
[backgroundView addSubview:scrollableText];
[[self view] addSubview:backgroundView];
}
不幸的是,這是行不通 – JAM