问题
I want to make an application which has Tab bar. In each TabBar I want to use Two Views that is Table View on left side and Detail View on other side. But the TableView should persist in portrait as well as landscape (same like setting app in iPad).
I have seen some recommendation of using private API that is a risk to use.
[splitViewController setHidesMasterViewInPortrait:NO];
and some tutorial like Matt Legend's https://github.com/mattgemmell/MGSplitViewController but I don't need that much customization.
Any Hint or tutorial in right direction would be highly appreciated.
The below tutorial is broken in 4.2 it seems:-
http://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/
回答1:
iOS 5 officially supports the following, which I believe is the effect you are trying to achieve:
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
return NO;
}
回答2:
Does using [splitviewcontroller setMasterHidesDisplay:NO]
cause Apple to reject the app on the appstore?
回答3:
Sometime back I tried to achieve a similar thing. After trying Matt's code, and unsucessfully trying to create a category I realized that the only way to do this(in a way that Apple doesn't reject your app) is to use two custom views. Refer this question.
回答4:
yep.
They rejected my app with this command
([splitviewcontroller setMasterHidesDisplay:NO] )
来源:https://stackoverflow.com/questions/5246248/splitviewcontroller-in-ipad-that-doesnt-hide-in-portrait