简体   繁体   中英

Odd Behavior When Using MFMessageComposeViewController

The issue I'm having is with both MFMessageComposeViewController as well as UIActivityViewController and the Message option.

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. I solved it by narrowing the scope on those appearance selectors to a UINavigationController subclass.

    [[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. Once I removed it, the behavior was correct. Strange and odd it is indeed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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