How can I set up a background image to UITextView?
The answers of @dulcanwilcox and @oxigen both work, but, an addition would be to make the background image resizable, in case the image is being used to show some kind of border.
UITextView *textView = [[UITextView alloc]initWithFrame: window.frame];
textView.text = @"Some text...";
UIImageView *imgView = [[UIImageView alloc]initWithFrame: textView.frame];
imgView.image = [[UIImage imageNamed: @"image"] resizableImageWithCapInsets:UIEdgeInsetsMake(8, 8, 8, 8)];
[textView addSubview:imgView];
[textView sendSubviewToBack:imgView];
[window addSubview:textView];
Check out the documentation for resizableImageWithCapInsets:(UIEdgeInsets)capInsets.