iPhone - Make loadView entries fill up parent view?

Posted by Eli on Stack Overflow See other posts from Stack Overflow or by Eli
Published on 2010-04-13T17:53:58Z Indexed on 2010/04/13 18:13 UTC
Read the original article Hit count: 248

Filed under:
|
|
|

I have a loadView call that basically places one view at the top (like a header) and one at the bottom (like a footer). It's possible via a passed in parameter to not have a header or a footer, to hide them later, or to resize the view. I have all this working, but it's very susceptible to breaking because the views can go in various places of various sizes and all must be manually set to the correct size or they will not use up all the space. I want one in between the two of them that automatically resizes to fill whatever space is not taken by the others.

loadView doesn't seem to be able to obtain the size of its parent's frame (or where it's being fit in, exactly), nor do I see an obvious way to just put the center view at a certain position and have its width and height automatically adapted.

Any ideas?

If I'm not explaining myself well enough and you know Java Swing, think BorderLayout with a BorderLayout.NORTH, BorderLayout.SOUTH, and BorderLayout.CENTER component.

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiview