gpt4 book ai didi

ios - iPad View 布局类似于 facebook

转载 作者:行者123 更新时间:2023-12-01 19:23:59 25 4
gpt4 key购买 nike

如何创建一个与 facebook 应用程序具有相似 View 布局的 ipad 应用程序?也就是说,当您将主视图向右滑动时,中心的一个大 View 和左侧的较小的类似菜单的 Controller 变得可见?
他们是在使用修改后的 Split View布局,还是这是自定义的多层布局?

我知道我可能必须使用一些手势识别器,但是谁能指出我如何重新制作 facebook 应用程序布局的正确方向?例如,两个主要 Controller 是什么(左侧的表格 View ,中间的全屏自定义 View ,位于表格 View 上方?),以及如何滑入/滑出菜单?

提前致谢

作为说明:我只需要横向,应该使变薄更容易。

[编辑] 这是我当前使用 viewdeckcontroller 的实现:

self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

RootViewController* menu = [[RootViewController alloc] init];
UINavigationController* navController= [[UINavigationController alloc] initWithRootViewController:menu];

DetailViewController* center = [[DetailViewController alloc] init];

IIViewDeckController* rootController = [[IIViewDeckController alloc] initWithCenterViewController:center leftViewController:navController];
_menuController = rootController;

rootController.leftLedge = [[UIScreen mainScreen] bounds].size.width - 50.0;

self.window.rootViewController = rootController;

[self.window makeKeyAndVisible];

这是 rootviewcontroller 类(左侧菜单 Controller ):
-(void)loadView 
{
// [super loadView];
// self.tableView = [[[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped] autorelease];

self.view= [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320, 704)];

UITableView* tableView= [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];

[self.view addSubview:tableView];

self.tableView= tableView;
}

最佳答案

这是一个完全符合您需要的插入式 Xcode 项目。 :)
https://github.com/devindoty/DDMenuController

关于ios - iPad View 布局类似于 facebook,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8856066/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com