CS 193 pスタンフォードIOS開発2011(七)

1437 ワード

UIToolbar
  • は一般にViewの一番上または一番下にあり、UIBarButtonItem
  • に加入することができる.
  • UIBarItemはstoryboardドラッグによって実現することもできるし、alloc/init法
  • によって実現することもできる.
    UISplitViewController
  • IPad Storyboardでのみ使用可能
  • はbase UI element
  • としてのみ使用できます.
    使用方法
  • デフォルトはbar buttonの後ろに
  • 隠されています.
    - (BOOL)splitViewController:(UISplitViewController *)sender
       shouldHideViewController:(UIViewController *)master
                  inOrientation:(UIInterfaceOrientation)orientation
    {
        return YES; // always hide it 
    }
    
  • bar buttonの後ろには永遠に隠れません
  • - (BOOL)splitViewController:(UISplitViewController *)sender
       shouldHideViewController:(UIViewController *)master
                  inOrientation:(UIInterfaceOrientation)orientation
    {
        return NO; // never hide it
     }
    
  • portraitモードでUIViewControllerの後ろに隠されている
  • - (BOOL)splitViewController:(UISplitViewController *)sender
       shouldHideViewController:(UIViewController *)master
                  inOrientation:(UIInterfaceOrientation)orientation
    {
        return UIInterfaceOrientationIsPortrait(orientation);
    }
    

    Popover
    popoverサイズの設定方法:
  • viewController内inspect
  • content VC controllerに
  • を設定
    @property (nonatomic) CGSize contentSizeForViewInPopover;
    
  • popover controllerにメッセージ
  • を送信
    - (void)setPopoverContentSize:(CGSize)size animated:(BOOL)animated;