IOS 新的 Facebook iPhone App UISplitViewController 布局

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7799888/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:54:40  来源:igfitidea点击:

IOS new Facebook iPhone App UISplitViewController Layout

iphoneiosfacebookuinavigationcontrolleruisplitviewcontroller

提问by Lisa Young

Possible Duplicate:
SplitView like Facebook app on iPhone

可能的重复:
SplitView 就像 iPhone 上的 Facebook 应用程序

another break away .net developer here now trying to get used to the world of IOS.

另一个脱离 .net 的开发人员现在试图适应 IOS 的世界。

I like the layout of the new Facebook iPhone app (October 2011), and want to implement something similar in an app I am doing. I know that the UISplitterControl is not available on iPhone but Facebook seem to have pulled a little magic to make it appear so on their new app.

我喜欢新的 Facebook iPhone 应用程序(2011 年 10 月)的布局,并希望在我正在做的应用程序中实现类似的功能。我知道 UISplitterControl 在 iPhone 上不可用,但 Facebook 似乎已经用了一点魔法让它在他们的新应用程序中出现。

In Facebook's implementation it looks to me that they have used a UINavigationController which slides to the right by x when the NavigationBar icon is tapped thus exposing a view underneath with the menu items.

在 Facebook 的实现中,在我看来,他们使用了一个 UINavigationController,当点击 NavigationBar 图标时,它会向右滑动 x,从而在下面暴露一个带有菜单项的视图。

Would appreciate if someone could help me work this out as the solution would also be a great learning curve.

如果有人能帮我解决这个问题,我将不胜感激,因为该解决方案也是一个很好的学习曲线。

I've tried setting a UINavigationController as the AppDelegate window root view controller, then using initwithframe to load a custom view which includes the menu items as a subview hidden behind the UINavigationcontroller root view. Then when the UINavgationController menu item button is clicked slide the NavigationController to the right thus exposing the view underneath with menu items.This presents two problems, first that the subview positioning doesn't work and also how can I slide the actual UINavigationController to the right to expose the menu view underneath.

我尝试将 UINavigationController 设置为 AppDelegate 窗口根视图控制器,然后使用 initwithframe 加载自定义视图,其中包含菜单项作为隐藏在 UINavigationcontroller 根视图后面的子视图。然后,当单击 UINavgationController 菜单项按钮时,将 NavigationController 向右滑动,从而暴露下面带有菜单项的视图。这存在两个问题,首先是子视图定位不起作用,以及如何将实际的 UINavigationController 滑动到右侧暴露下面的菜单视图。

Please help!

请帮忙!

回答by pkluz

Might also want to check out my implementation on Github. It's specifically designed to resemble Facebook's implementation as much as possible (from a technical point of view). Also it leverages iOS 5's new UIViewController-Containment features, which most others don't. Thus it works flawlessly in both landscape and portrait modes. It's universal of course and highly flexible. One class only. The way you use it is similar to any other Apple made controller.

可能还想查看我在 Github 上的实现。它专门设计为尽可能地类似于 Facebook 的实现(从技术角度来看)。此外,它还利用了 iOS 5 的新 UIViewController-Containment 功能,而大多数其他功能则没有。因此,它在横向和纵向模式下都能完美运行。它当然是通用的并且非常灵活。只有一节课。您使用它的方式类似于任何其他 Apple 制造的控制器。

回答by James Tang

there is a similar post here: SplitView like Facebook app on iPhone.

这里有一个类似的帖子:SplitView like Facebook app on iPhone

you can also checkout the code directly at: https://github.com/mystcolor/JTRevealSidebarDemo

您也可以直接在以下位置签出代码:https: //github.com/mystcolor/JTRevealSidebarDemo

回答by Wilson Shum

I'm having exactly the same question, my guess is that the "SplitView" is actually more likely a modal view that takes up only part of the screen. I haven't had the time to try it just yet but the following post might give some hint on how this can be done:

我有完全相同的问题,我的猜测是“SplitView”实际上更可能是一个仅占屏幕一部分的模态视图。我还没有时间尝试它,但下面的帖子可能会提供一些关于如何做到这一点的提示:

http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/

http://ramin.firoozye.com/2009/09/29/semi-modal-transparent-dialogs-on-the-iphone/

回答by Chris

You might want to check out this project

你可能想看看这个项目

https://github.com/aaronbrethorst/StackScrollView

https://github.com/aaronbrethorst/StackScrollView

Here some howto http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience

这里有一些操作方法 http://cocoacontrols.com/posts/how-to-build-the-twitter-ipad-user-experience

Similar to the one "MyPad" is using.

类似于正在使用的“MyPad”。

Note: This is only for iPad but you might find some usefull stuff in it

注意:这仅适用于 iPad,但您可能会在其中找到一些有用的东西

回答by Michael Frederick

I created a component that mimics the behavior of the Facebook slide out menu. It is available on github.

我创建了一个模仿 Facebook 滑出菜单行为的组件。它在 github可用

回答by Dejan Balaban

Here is link from stack overflow where people have discussed on same topic. Also there are several links that can be helpful: SplitView like Facebook app on iPhone

这是人们讨论同一主题的堆栈溢出链接。还有几个链接可以提供帮助: SplitView like Facebook app on iPhone