Hi, in my app I am adding a background to UITextView. But when the text view scrolls down the image goes together with the text and the background for new lines of text appears to be white. Is there an easy way to cope with it? Here is my code:
textView = [ [UITextView alloc] initWithFrame: CGRectMake(10, 100, 270, 130)];
UIImageView *imgView = [ [UIImageView alloc]initWithFrame: CGRectMake(0, 0, 270, 130)];
imgView.image = [UIImage imageNamed: @"background.png"];
[textView addSubview: imgView];
[textView sendSubviewToBack: imgView];
[imgView release];
textView.opaque = YES;
textView.editable = YES;
textView.font = [UIFont systemFontOfSize: 12];
textView.textColor = [UIColor colorWithRed: 10.0f/255.0f green: 10.0f/255.0f blue: 10.0f/255.0f alpha: 1.0f];
textView.autocapitalizationType = UITextAutocapitalizationTypeNone;
textView.delegate = self;
[mainScrollView addSubview: textView];
I want the background to remain static with the text scrolling on top of it.