私のアプリで私はUITextViewの背景を追加しています。しかし、テキストビューが下にスクロールすると、イメージはテキストと一緒になり、新しいテキスト行の背景が白く表示されます。それに対処する簡単な方法はありますか?私は背景がテキストは、その上にスクロールすると静的なままにしたいスクロールバックグラウンド
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];
: はここに私のコードです。
あなたは背景があなたがスクロールするように移動するか、その上にスクロールテキストと静止したままにしますか? – pgb
私はバックグラウンドをテキストの上にスクロールして静的にしておきたい。 –