除了presentModalViewController之外,还有其他方法可以在屏幕的一部分上显示UITabBarController吗?
我有一个 UITabBarController
在我的应用程序中显示许多设置屏幕。出于布局原因,我希望它们仅显示在屏幕的一部分上。在全屏下,列表变得不可读(太宽),每个页面只有几个控件,使页面感觉非常空,并且选项卡栏按钮远离内容(费茨定律)。
将 presentModalViewController
与 UIModalPresentationFormSheet
样式一起使用可以给我我想要的大小。我在空背景上执行此操作,因为在我的情况下,在其后面显示任何内容是没有意义的。 “真实”工作区域显示为全屏模式下的另一个 presentModalViewController
。
这可行,但感觉像是黑客。一个问题是,我无法使用 UIModalTransitionStyleFlipHorizontal
样式使设置对话框后面的背景在过渡到全屏时移动。
TL;DR
我可以在另一个“背景”视图中嵌入一个非全屏的 UITabBarController
吗?我找不到任何有关如何执行此操作的信息。
I have a UITabBarController
displaying a number of settings-screens in my app. I want them to be shown on just a part of the screen for layout reasons. In fullscreen, the lists become unreadable (too wide), there are just a few controls per page making the page feel very empty, and the tabbar buttons are far away from the content (Fitts law).
Using presentModalViewController
with the UIModalPresentationFormSheet
style gives me the size I want. I do this on top of an empty background, since in my case it doesn't make sense to display anything behind it. The "real" working area is displayed with another presentModalViewController
in fullscreen mode on top of it all.
This works but feels like a hack. One problem is, I can't make the background behind the settings dialog move in the transition to fullscreen with the UIModalTransitionStyleFlipHorizontal
style.
TL;DR
Can I embed a UITabBarController
non-fullscreen in another "background"-view? I can't find any information of how I would do this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你为什么不尝试一下呢?
[containerView addSubview:tabBarController.view];
Why don't you try it out?
[containerView addSubview:tabBarController.view];