1

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/

Vin
  • 10,517
  • 10
  • 58
  • 71
Ekra
  • 3,241
  • 10
  • 41
  • 61

4 Answers4

7

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; }

mangaman
  • 86
  • 1
  • 2
  • This works in the recent versions! This answer is far too hidden, it really needs to get spread around. This question has been asked NUMEROUS times, with all answers saying to use MGSplitViewController, but now we can finally use a much simpler way now that Apple has added the functionality! – Highrule Jun 20 '12 at 15:32
1

Does using [splitviewcontroller setMasterHidesDisplay:NO] cause Apple to reject the app on the appstore?

BryanH
  • 5,826
  • 3
  • 34
  • 47
manishnath
  • 444
  • 1
  • 3
  • 12
0

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.

Community
  • 1
  • 1
Vin
  • 10,517
  • 10
  • 58
  • 71
  • thanks for your reply. If we are creating 2 custom view than can we put 2 navigation bars in a same screen? – Ekra Mar 10 '11 at 06:09
  • Sorry for late reply, I thought I had already answered. as everything is custom, you can do whatever you want. But of course you can't use the two navigation bars with a single controller. – Vin Mar 11 '11 at 18:54
0

yep. They rejected my app with this command ([splitviewcontroller setMasterHidesDisplay:NO] )

Vin
  • 10,517
  • 10
  • 58
  • 71