关闭模态视图控制器后 UIToolbar 消失

发布于 2024-09-25 20:00:38 字数 836 浏览 2 评论 0原文

我知道你们中的一些人可能不熟悉 Monotouch,但这肯定是一般的 iOS 问题,而不是特定的 Monotouch 问题。

我正在重新创建一个与默认邮件应用程序具有类似功能的应用程序: UITableview with UIToolbar at Bottom

这是一个简单的重新创建我们的应用程序。它是一个 UIView,其中包含一个 UITableView 和一个 UIToolbar。它是从 XIB 文件(包含随附的视图控制器代码)加载的。这个视图是一个 UITabController 视图(尽管我确信这不会影响事情?)。

alt text

这是从导航控制器推送的

controller.PushViewController(inboxItem.Controller, true);

(其中 inboxItem 是我制作的自定义对象,Controller 属性是 inboxItem 的视图控制器)。

按下工具栏上的右侧按钮会显示一个新的模式视图(撰写新消息) - 它会完成其工作,无论以哪种方式关闭,关闭后,UIToolbar都会消失。但是,如果我要单击另一个选项卡,然后单击返回此选项卡,工具栏将重新出现。这是重绘问题吗?

我构建应用程序的方式是否有问题?或者我碰巧发现了一些奇怪的 iOS/Monotouch 错误? (我希望是前者——这样我就可以改进我的 iOS 开发)。

I'm aware some of you may not be familiar with Monotouch, but this could certainly be a general iOS issue rather than a specific Monotouch issue.

I'm recreating an app with similar functionality to the default mail app: UITableview with UIToolbar at bottom

This is a simple recreation of our app. It's a UIView which contains a UITableView and a UIToolbar. It's loaded from a XIB file (which contains accompanying view controller code). This view is a UITabController view (though I'm sure this shouldnt affect things?).

alt text

This has been pushed from a navigation Controller using

controller.PushViewController(inboxItem.Controller, true);

(where inboxItem is a custom object I've made, the Controller property being the inboxItem's view controller).

Pressing the right hand button on the toolbar presents a new modal view (compose new message) - which does its thing and no matter which way its dismissed, upon dismissal, the UIToolbar disappears. However, if I am to click on another tab then click back onto this tab, the Toolbar reappears. Is this a redraw issue?

Am I doing something wrong with the way I'm structuring my app? Or have I happened to stumble across some bizarre iOS/Monotouch bug? (I'm hoping it's for the former - so I can improve my iOS development).

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

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

发布评论

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

评论(1

掩于岁月 2024-10-02 20:00:38

我解决了这个问题。基本上,发生的情况是当 ModalView 呈现然后关闭时,工具栏每次向下移动 44 像素。

在我的示例中,工具栏放置在 UITabBar 上方,因此当模式视图关闭时,工具栏将移出视图。我不确定为什么会发生这种情况,但我一定会提交适当的错误报告。

解决这个问题的一种快速且(非常)肮脏的方法是在显示模态视图时将工具栏向上移动 44 像素,这样当它被关闭时,它会将其向下移动回适当的位置。

I solved the problem. Basically, what was happening was when the ModalView was being presented and then dismissed, the toolBar was being moved down by 44 pixels each time.

In my example, the toolBar is placed above a UITabBar, so when the modal view was dismissed the toolbar was being moved out of view. I'm not sure why this is happening but I'll be sure to file appropriate bug reports.

One quick and (very) dirty way around this is to move the toolBar up 44 pixels when displaying the modalview, so that when it is dismissed, it will move it back down to the appropriate position.

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