【发布时间】:2015-06-16 09:35:56
【问题描述】:
我已经实现了一个自定义键盘。它在运行 iOS 8.2 的设备上运行良好。
但是,当我在装有 iOS 8.3 的设备上运行相同的代码时,我收到以下警告,并且键盘的高度设置不正确:
Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints)
(
"<NSAutoresizingMaskLayoutConstraint:0x15dd1da0 h=-&- v=-&- Keyboard:0x15db2b00.width == UIView:0x15da7b90.width - 320>",
"<NSLayoutConstraint:0x15dd2520 'UIView-Encapsulated-Layout-Width' H:[UIView:0x15da7b90(0)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x15dd2520 'UIView-Encapsulated-Layout-Width' H:[UIView:0x15da7b90(0)]>
我不知道这意味着什么。请帮我弄清楚。
【问题讨论】:
-
我实际上在 8.2 设备上看到了此消息,根据我的经验,它实际上表明您的约束 已 得到遵守并且您的高度已正确设置。您在 8.3 设备上仍然拥有完全访问权限吗?
UIInputView中还有其他带有自动布局约束的视图吗? -
@BenPious 不幸的是高度也没有正确设置。
标签: objective-c ios8 autolayout custom-keyboard