Take the 2-minute tour ×

I'm building a custom view inside of Interface Builder that has buttons with image backgrounds. The buttons extend to each side of the screen, so I'll need two images for each layout (Portrait and Landscape). As such, do I need to have two different NIB files for each layout (Portrait and Landscape), or is there a way to just use one NIB file and specify which images to use for the buttons depending on which layout the app is running in?

Thanks so much in advance for all your help!

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You should use 1 nib file. Give each control the correct autoresizingMask to ensure they scale and position correctly when the orientation changes.

Changing the images should be done in the view controller by overriding one of these methods:


More info about these methods are in the docs.

share|improve this answer
thanks, rengers! –  BeachRunnerFred Jul 24 '10 at 16:46
add comment

Your Answer


