Search code examples
xcodexcode4

How to create a xib file with a smaller view?


Can I design a View smaller than the complete iPad screen size with UI Builder in xCode 4 ? If so, how ?

I need to design a small View I'm going to use multiple times in the same main UIView. I would like to design it with UI Builder, and then load it from xib.

But when I create a new xib file, the view size is always the iPad size.. thanks


Solution

  • When you create a new view, simply select the "Empty" option, rather than the View option.

    You can then drop a UIView on it - the difference being that you can re-size this view via the Size inspector (the little ruler icon) within the utilities pane. (The one on the left.)