u16suzuの blog

日々学んだことのメモブログです。

透明なモーダルビューを自作する

こんな感じ。MyViewControllerは表示したいものを指定。windowに addSubviewする。

    MyViewController *vc = [[MyViewController alloc]init];
    AppDelegate *delegate =  (AppDelegate *)[UIApplication sharedApplication].delegate;
    [delegate.window addSubview:vc.view];

windowに直接 addSubviewしないで self.viewに addSubviewすると、ナビバーは有効のままになってしまう。
参考: http://stackoverflow.com/questions/849458/transparent-modal-view-on-navigation-controller