开发者

Make a UITextView go full screen

开发者 https://www.devze.com 2023-02-17 19:24 出处:网络
I would like to make a UITextView go full screen. How开发者_运维问答 would I implement this? Thanks for your help.Instead of using hard coded values for your frame I would recommend using:

I would like to make a UITextView go full screen. How开发者_运维问答 would I implement this?

Thanks for your help.


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).


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消