超越默认splitviewcontroller功能的MGSpliatviewController

来源:互联网 发布:c语言调用函数大全 编辑:程序博客网 时间:2024/06/06 07:25

https://github.com/mattgemmell/


Features

Please note that, since split-views are commonly used for "Master-Detail" interfaces, I call the first sub-view the "master" and the second sub-view the "detail".

  • By default, MGSplitViewController mimics the appearance and (complete) behaviour of UISplitViewController, including its delegate API. It accepts two UIViewControllers (or subclasses thereof).
  • Allows toggling the visibility of the master view in either interface-orientation; i.e. you can have master-detail or detail-only in either landscape and/or portrait orientations (independently, and/or interactively).
  • Allows choosing whether the split orientation is vertical (i.e. left/right, like UISplitViewController), or horizontal (master above, and detail below). You can toggle between modes interactively, with animation.
  • Allows choosing whether the master view is before (above, or to left of) the detail view, or after it (below, or to the right).
  • Allows you to choose (and change) the position of the split, i.e. the relative sizes of the master and detail views.
  • Allows you to enable dragging of the split/divider between the master and detail views, with optional constraining via a delegate method.
  • Allows you to choose the width of the split between the master and detail views.
  • Preset "divider styles": one for non-draggable UISplitViewController-like dividers, and one for draggable, thicker style with a grip-strip.
  • Allows you to substitute your own divider-view (an MGSplitDividerView subclass), used to draw the split between the master and detail views.

How to use

The "MGSplitViewController.h" header file (and the sample project) should be self-explanatory. It's recommended that you use the project as a reference.



原创粉丝点击