In iOS 5.0+, you should be able to use the appearance proxy for UITextView like so:
[[UITextView appearance] setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight];
This would make all UITextView's respond with a flexible width and height. Here's a great tutorial on how to use the proxy for other UI controls:
http://www.raywenderlich.com/4344/user-interface-customization-in-ios-5
EDITED:
This code should work and I've tested this in both the simulator and on an iPhone directly, even though the autoresizingMask
property in UIView.h is not flagged with UI_APPEARANCE_SELECTOR
. This post seems to indicate that its possible for a property to not have this flag, yet still obey messages from the appearance proxy. All that said, @rmaddy is right. It might be a risk to rely on this long-term.