模态视图控制器底部有白色条纹

发布于 2024-12-08 08:31:02 字数 274 浏览 0 评论 0原文

我有一个 ViewController 子类,我将其呈现为模式视图:

MyViewController *myViewController = [[MyViewController alloc] init];
[self presentModalViewController:myViewController animated:YES];

但是,模式视图在底部显示有白色条纹,大约是标题或导航栏的高度。我的应用程序是由导航控制的。如何去掉白色条纹(最好添加标题栏)?

I have a ViewController subclass that I'm presenting as a modal view:

MyViewController *myViewController = [[MyViewController alloc] init];
[self presentModalViewController:myViewController animated:YES];

However, the modal view showing up with a white stripe on the bottom, approximately the height of the title or navigation bar. My app is otherwise navigation controlled. How do I get rid of the white stripe (and ideally add a title bar)?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦魇绽荼蘼 2024-12-15 08:31:02

我不确定这是否是您问题中的两件事之一,您是否试图将导航控制器添加到模态视图控制器中,或者您是否试图从模态视图中隐藏导航控制器。
我怀疑您实际上可能想将代码更改为以下内容,以从 NavigationController 呈现模式视图控制器,

 MyViewController *myViewController = [[MyViewController alloc] init];
[[self navigationController] presentModalViewController:myViewController animated:YES];

然后在 MyViewController 对象上调用 setTitle: 来设置它的标题。

I'm not sure if this is one of two things from your question, are you trying to add a navigation controller to your modal view controller, or are you trying to hide your navigation controller from your modal view.
I suspect you may want to in fact change your code to the following to present your modal view controller from your NavigationController

 MyViewController *myViewController = [[MyViewController alloc] init];
[[self navigationController] presentModalViewController:myViewController animated:YES];

Then call setTitle: on you MyViewController object to set the title for it.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文