Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a UITextView go full screen

I would like to make a UITextView go full screen. How would I implement this?

Thanks for your help.

like image 805
Prasanna Avatar asked Apr 25 '26 10:04

Prasanna


2 Answers

Instead of using hard coded values for your frame I would recommend using:

CGRect r = [[UIScreen mainScreen] bounds];
[textView setFrame:r];

This would make your code more future proof (and work on all iOS devices).

like image 154
Konrad77 Avatar answered Apr 27 '26 00:04

Konrad77


I am not very clear about your requirement.

But if you want that textview becomes as big as the view (leaving the tabbar and Navigationbar if exists) then you can simply set the frame of your textView to (0,0,320,480).

You can do this from XIB or you can set it dynamically using IBOutlet of your textView as shown below

[textView setFrame:CGRectMake(0,0,320,480);

Hope this helps you.

If your requirement is different then do let me know, I would be more than happy to re-structure my answer to satisfy your requirement.

like image 38
Parth Bhatt Avatar answered Apr 26 '26 23:04

Parth Bhatt