iPad 中的 splitViewController 不会隐藏在纵向中
我想制作一个具有标签栏的应用程序。在每个 TabBar 中,我想使用两个视图,即左侧的表格视图和另一侧的详细信息视图。但 TableView 应该保持纵向和横向(与 iPad 中的设置应用程序相同)。
我看到一些使用私有 API 的建议,但使用起来有风险。
[splitViewController setHidesMasterViewInPortrait:NO];
以及一些教程,例如 Matt Legend 的 https://github.com/mattgemmell/MGSplitViewController 但我不需要那么多定制。
任何正确方向的提示或教程将不胜感激。
下面的教程似乎在 4.2 中被破坏了:-
http ://blog.blackwhale.at/2010/04/your-first-ipad-split-view-application/
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/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
iOS 5 正式支持以下内容,我相信这就是您想要实现的效果:
- (BOOL)splitViewController:(UISplitViewController *)svc shouldHideViewController:(UIViewController *)vc inOrientation:(UIInterfaceOrientation)orientation
{
返回否;
}
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;
}
使用
[splitviewcontroller setMasterHidesDisplay:NO]
是否会导致 Apple 拒绝应用商店上的应用?Does using
[splitviewcontroller setMasterHidesDisplay:NO]
cause Apple to reject the app on the appstore?不久前我试图实现类似的目标。在尝试了 Matt 的代码并且尝试创建类别失败后,我意识到执行此操作的唯一方法(以 Apple 不会拒绝您的应用程序的方式)是使用两个自定义视图。请参阅此问题。
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.
是的。
他们用这个命令拒绝了我的应用程序
([splitviewcontroller setMasterHidesDisplay:NO])
yep.
They rejected my app with this command
([splitviewcontroller setMasterHidesDisplay:NO] )