UIView bounds with top bar

When creating a UIView with a navigation bar in interface builder, the top bar takes some space, but the view still has the same size. This mean that the bottom of the view is not visible.

Is there a way to get the "visible size" of a UIView? I would like to show a subview at the bottom of the screen, but part of the subview is hidden since the parent view goes "below" the screen.

Answers


You should use the 'struts-and-springs' control in IB to set your base view to be full-justified. Then it will auto-resize. Once you do this, you can just use the view.bounds property to access its visible area.


You should use Ben Gottlieb's solution but in terms of calculating the visible area of a view named "view", you could probably use:

CGRect viewBoundsInWindow =
    [[[UIApplication sharedApplication] keyWindow] convertRect:view.layer.visibleRect fromView:view];

Need Your Help

For a newbie: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock'

mysql macos

I installed MySQL on Mac OS X Mountain Lion with homebrew install mysql, but when I tried mysql -u root I got the following error:

How to attach a flat file into informatica Email?

email attachment xls email-attachments informatica

I want to send a mail to some users after workflow is done. This email should contain 3 xls file or 1 xls file with 3 sheets. The xls file contains a query result -less than 50 rows- which is loade...