开发者

Conditional interface programming for iPad?

I'm working on an app for the iPad and am a little over my head with one issue. Is it possible to build an app for iPad that uses a function to control which interface layout is displayed? Something like "if these parameters are开发者_JS百科 met, use XIB file "a" else use XIB file "b". I know that's not in any kind of legitimate format, but you get the idea.

If this is possible, does anyone know of any tutorials on how to do it or sample code I could look at?

Thanks!


I think you want to show two xibs with same content but different orientations. If this is the case you should avoid doing this rather change the frames of your content when the orientation changes.


Rather than draw a connection from your app delegate to the main view controller in your xib, instantiate the view controller in applicationDidFinishLaunching. [UIViewController initWithNibName:bundle:] allows you to specify which xib to use.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜