美文网首页
CS193p 斯坦福IOS开发 2011 (七)

CS193p 斯坦福IOS开发 2011 (七)

作者: ItchyHiker | 来源:发表于2019-02-14 11:19 被阅读0次

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 (七)

      本文链接:https://www.haomeiwen.com/subject/sfadjqtx.html