CS193p 斯坦福IOS开发 2011 (七)

UIToolbar

  1. 一般在View的最上面或者最下面,可以加入UIBarButtonItem
  2. UIBarItem可以通过storyboard拖拽实现,也可以通过alloc/init方法

UISplitViewController

  1. 只能在IPad Storyboard使用
  2. 只能作为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;

你可能感兴趣的:(CS193p 斯坦福IOS开发 2011 (七))