使用 PartialCurl 模型转换时视图会调整大小
好吧,我正在尝试重新创建部分折叠动画,就像 iPhone 上的标准谷歌地图应用程序一样,底部的工具栏保持在原来的位置,但上面的视图卷曲等。以下是一些图片: https://i.sstatic.net/MjTx6.png
(由于某种原因不允许我放入超链接<_< ;)
http://i.imgur.com/lc9ig.png http://i.imgur.com/hqMlN.png
如您所见,白色视图的大小正确(320x416,点:(0,0)),并且向上翻转。工具栏保持在原来的位置。当焦点返回到白色视图时,它会调整自身大小(320x460,点:(0,-22))。
我已将 viewWillAppear、viewWillDissapear、viewDidAppear 和 viewDidDissapear 添加到白色视图类中,但这些方法都没有被调用(这很奇怪,因为我假设首次初始化视图时会调用出现的方法)。
这是我初始化白色视图的地方:
- (void)viewDidLoad {
[super viewDidLoad];
mapController = [[MapViewController alloc] init];
mapController.modalPresentationStyle = UIModalPresentationFullScreen;
[self.view addSubview:mapController.view];
}
这就是当您点击卷曲按钮时发生的情况:
- (IBAction)curlPage:(id)sender {
SettingsViewController *settingsController = [[[SettingsViewController alloc] init] autorelease];
settingsController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[mapController presentModalViewController:settingsController animated:YES];
}
所以我想我的问题是:当控件返回到白色视图(mapController)时,会调用哪些方法,我可以在其中手动调整视图大小回到我想要的大小,或者有什么方法可以阻止它自行调整大小。
谢谢
Ok so I'm trying to recreate the partial fold animation like in the standard google maps app on the iphone where the toolbar at the bottom stays where it is, but the views above it curl and such. Here are some images:
https://i.sstatic.net/MjTx6.png
(Wont let me put in hyperlinks for some reason <_<)
http: // i.imgur.com/lc9ig.png
http: // i.imgur.com/hqMlN.png
As you can see, the white view is sized correctly (320x416, point: (0,0)), and gets flipped up. The toolbar stays where it is. When focus returns back to the white view, it resizes itself (320x460, point: (0,-22)).
I have added viewWillAppear, viewWillDissapear, viewDidAppear and viewDidDissapear to the white view class and none of those methods ever get called (which is weird because I would assume the appear ones would be called when the view is first initialized).
Here is where I initialize the white view:
- (void)viewDidLoad {
[super viewDidLoad];
mapController = [[MapViewController alloc] init];
mapController.modalPresentationStyle = UIModalPresentationFullScreen;
[self.view addSubview:mapController.view];
}
and this is what happens when you hit the curl button:
- (IBAction)curlPage:(id)sender {
SettingsViewController *settingsController = [[[SettingsViewController alloc] init] autorelease];
settingsController.modalTransitionStyle = UIModalTransitionStylePartialCurl;
[mapController presentModalViewController:settingsController animated:YES];
}
So I guess my question is: When the control returns to the white view (mapController) what methods get called where I can manually resize the view back to the size I want it at, or is there a way I can stop it from resizing itself.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我最终找到了这个问题的答案。我不确定为什么要调整它的大小,但在 viewWillDissapear 中手动设置框架似乎可以解决问题。
Well I ended up figuring out the answer to this. Im not sure why it was being resized, but setting the frame manually in
viewWillDissapear
seemed to fix the problem.