开发者

Changing Views From Inside App

I have a one View Controller Called ThemeViewController with three nibs, all of which are a different theme.

I want to ch开发者_开发技巧ange the nib simply by hitting a button from within the app. I placed this method from within the ThemeViewController class.

- (IBAction)switchTheme {
      self = [[ThemeViewController alloc] initWithNibName:@"theme_1" bundle:nil];   
}

Any help or suggestions? Thanks


Use this instead:

[[NSBundle mainBundle] loadNibNamed:@"yourNibName" owner:self options:nil];
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜