I want to increase textview height based on text-length i tried some code but result is coming like first image but i want to come the result like second image.
code:
- (void)viewDidLoad {
[super viewDidLoad];
textview.text = @"This returns the size of the rectangle that fits the given string with the given font. Pass in a size with the desired width and a maximum height, and then you can look at the height returned to fit the text. There is a version that lets you specify line break mode also.This returns the size of the rectangle that fits the given string with the given font. Pass in a size with the desired width and a maximum height, and then you can look at the height returned to fit the text. There is a version that lets you specify line break mode yes.";
CGRect frame = textview.frame;
frame.size.height = textview.contentSize.height;
textview.frame = frame;
textview.ScrollEnabled = NO;
}