And then have it merged in vertical view? Here is an example from the IMDB app.

They did it perfectly and I would like to know how I can replicate it. Right now, I can't seem to add it to 开发者_如何学Cthe left side of the split controller. Thanks in advance.
Short answer, you don't.
What you have is two UIToolbars and some code that moves the content of one onto the other when the UISplitViewController calls its delegate's
– splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
method and that moves the items back again in the delegate's
– splitViewController:willShowViewController:invalidatingBarButtonItem:
method.
For example this might work:
– splitViewController:willHideViewController:withBarButtonItem:forPopoverController:
{
// …
NSArray *leftItems = leftBar.items;
rightBar.items = [leftItems arrayByAddingObjectsFromArray:rightBar.items];
leftBar.hidden=YES;
// …
}
– splitViewController:willShowViewController:invalidatingBarButtonItem:
{
// …
NSArray *rightItems = rightBar.items;
NSUInteger lc = [leftBar.items count];
rightBar.items = [rightItems subArrayWithRange:NSMakeRange(lc,[rightItems count] - lc)];
leftBar.hidden=NO;
// …
}
加载中,请稍侯......
精彩评论