键盘关闭iOS8后,是否可以看到inputAccessoryView? [英] Leaving inputAccessoryView visible after keyboard is dismissed iOS8?

查看:373
本文介绍了键盘关闭iOS8后,是否可以看到inputAccessoryView?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想像消息传递应用程序一样做出行为。我一直在浏览Stack Overflow的解决方案,确实有很多:




I want to make behavior like messaging app. I have been browsing Stack Overflow for solutions for this, and indeed there are plenty:

Leaving inputAccessoryView visible after keyboard is dismissed

This was the one that I found. But it seems things are a little different in iOS8. If I do the same thing in new iOS8 sdk, i get error:

'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fdcb3441b10> should have parent view controller:<ViewController: 0x7fdcb3b1e9f0> but requested parent is:<UIInputWindowController: 0x7fdcb684c000>'

In order to test this more I made a sample project, just one controller with view on the bottom:

Outlet is connected to bottom view, that only has UITextField on it. Am I missing something and how do i get the desired behvior?

解决方案

iOS8 has a retain cycle with the inputAccessoryView. Here's a good post that seems to have a good workaround:

http://derpturkey.com/uitextfield-docked-like-ios-messenger/

这篇关于键盘关闭iOS8后,是否可以看到inputAccessoryView?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆