简体   繁体   English

使用MFMessageComposeViewController时的奇怪行为

[英]Odd Behavior When Using MFMessageComposeViewController

The issue I'm having is with both MFMessageComposeViewController as well as UIActivityViewController and the Message option. 我遇到的问题是MFMessageComposeViewController以及UIActivityViewController和Message选项。

The dialog is presented properly, but when I select a recipient, the entire recipient field slides up under the navigation bar. 该对话框显示正确,但是当我选择一个收件人时,整个收件人字段会在导航栏下向上滑动。 You can actually see the presenting view controller beneath it. 您实际上可以看到其下面的呈现视图控制器。 Also, when the autocomplete list appears when typing an address, the list actually starts about half way down the screen, typically under the keyboard. 同样,当键入地址时出现自动完成列表时,该列表实际上从屏幕下方大约一半处开始,通常在键盘下方。

I created a simple sample app, which doesn't have the issue. 我创建了一个简单的示例应用程序,没有出现问题。 It's only with my app. 仅与我的应用有关。

The only thing I can think of is that these dialogs a presented from a view controller that is already presented itself, but otherwise I have no idea what could be the issue. 我唯一能想到的是这些对话框是从本身已经呈现的视图控制器呈现出来的,但是否则我不知道可能是什么问题。

偏移量自动完成收件人丢失

I ran into the same issue. 我遇到了同样的问题。 In my case it was caused by using appearance selectors on UINavigationBar, which it looks like you might be doing as well. 在我的情况下,这是由在UINavigationBar上使用外观选择器引起的,看起来您也可能这样做。 I solved it by narrowing the scope on those appearance selectors to a UINavigationController subclass. 我通过将这些外观选择器的范围缩小到UINavigationController子类来解决它。

    [[UINavigationBar appearanceWhenContainedIn:[MYNavigationController class], nil] setBackgroundImage:... forBarMetrics:...];

rather than 而不是

    [[UINavigationBar appearance] setBackgroundImage:... forBarMetrics:...];

I have had the same problem. 我曾经也有过一样的问题。

In my AppDelegate I set an BackgroundImage to my custom NavBar. 在我的AppDelegate中,将BackgroundImage设置为自定义NavBar。 Once I removed it, the behavior was correct. 一旦删除它,该行为是正确的。 Strange and odd it is indeed. 确实很奇怪。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM