UIToolbar
- 一般在View的最上面或者最下面,可以加入UIBarButtonItem
- UIBarItem可以通過storyboard拖拽實現(xiàn),也可以通過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
如何設(shè)置popover大小:
- 在viewController里面inspect
- 在content VC controller 里面設(shè)置
@property (nonatomic) CGSize contentSizeForViewInPopover;
- 給popover controller發(fā)送消息
- (void)setPopoverContentSize:(CGSize)size animated:(BOOL)animated;