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;
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 1,Search Bar 怎样去掉背景的颜色(storyboard里只能设置background颜色,可是发现cl...
    以德扶人阅读 2,430评论 2 50
  • 更好的阅读体验,请到个人博客阅读: iOS中的系统转场 请忽略标题,😂,本文记录的是对下图所示的Kind, Pre...
    CaryaLiu阅读 2,376评论 0 1
  • 参考文章 navigationItem UINavigationItem UINavigationBar UIBa...
    刘大帅阅读 52,708评论 37 147
  • 2018年真的只剩下最后一天了,除了时间过得真快的同时,年终还有一件重要的事,那就是自我结算,对一年以来自己的工作...
    小叶子9424阅读 116评论 0 0
  • 7.8评分。法国动作犯罪剧情片。11.30上映。
    Bonnie_Ho阅读 358评论 0 0