<bdo id='etici'></bdo><ul id='etici'></ul>

<small id='etici'></small><noframes id='etici'>

<tfoot id='etici'></tfoot>

    <legend id='etici'><style id='etici'><dir id='etici'><q id='etici'></q></dir></style></legend>
    1. <i id='etici'><tr id='etici'><dt id='etici'><q id='etici'><span id='etici'><b id='etici'><form id='etici'><ins id='etici'></ins><ul id='etici'></ul><sub id='etici'></sub></form><legend id='etici'></legend><bdo id='etici'><pre id='etici'><center id='etici'></center></pre></bdo></b><th id='etici'></th></span></q></dt></tr></i><div id='etici'><tfoot id='etici'></tfoot><dl id='etici'><fieldset id='etici'></fieldset></dl></div>

    2. 自定义键盘中的 iOS 8.3 'UIView-Encapsulated-Layout-Width'

      时间:2023-09-09
        <tbody id='yTk24'></tbody>
    3. <i id='yTk24'><tr id='yTk24'><dt id='yTk24'><q id='yTk24'><span id='yTk24'><b id='yTk24'><form id='yTk24'><ins id='yTk24'></ins><ul id='yTk24'></ul><sub id='yTk24'></sub></form><legend id='yTk24'></legend><bdo id='yTk24'><pre id='yTk24'><center id='yTk24'></center></pre></bdo></b><th id='yTk24'></th></span></q></dt></tr></i><div id='yTk24'><tfoot id='yTk24'></tfoot><dl id='yTk24'><fieldset id='yTk24'></fieldset></dl></div>

        • <tfoot id='yTk24'></tfoot>
            <bdo id='yTk24'></bdo><ul id='yTk24'></ul>

              • <legend id='yTk24'><style id='yTk24'><dir id='yTk24'><q id='yTk24'></q></dir></style></legend>

                <small id='yTk24'></small><noframes id='yTk24'>

                本文介绍了自定义键盘中的 iOS 8.3 'UIView-Encapsulated-Layout-Width'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我已经实现了一个自定义键盘.它在运行 iOS 8.2 的设备上运行良好.

                I have implemented a custom keyboard. It works fine on a device which runs iOS 8.2.

                但是,当我在装有 iOS 8.3 的设备上运行相同的代码时,我收到以下警告,并且键盘的高度设置不正确:

                However, when I run the same code on a device with iOS 8.3 I get the following warnings and the height of the keyboard is not set properly:

                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)]>
                

                我不知道这意味着什么.请帮我弄清楚.

                I have no idea what this means. Please help me figure it out.

                推荐答案

                    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)]>
                

                它告诉你它不能同时满足所有约束.

                It is telling you that it can't satisfy all constraints at once.

                您有一个约束 <NSAutoresizingMaskLayoutConstraint:0x15dd1da0 h=-&- v=-&- Keyboard:0x15db2b00.width == UIView:0x15da7b90.width - 320>,它规定了键盘的宽度等于 0x15da7b90 处的 UIView 的宽度减去 320(检查调试器这是哪一个,如果我知道 UIViews 可能会导致问题).

                You have a constraint <NSAutoresizingMaskLayoutConstraint:0x15dd1da0 h=-&- v=-&- Keyboard:0x15db2b00.width == UIView:0x15da7b90.width - 320>, which dictates the width of the keyboard equals the width of the UIView at 0x15da7b90 minus 320 (check the debugger which one this is, I usually look at the GUI debugger if I know what UIViews might be causing the problem).

                另一个冲突的约束是 <NSLayoutConstraint:0x15dd2520 'UIView-Encapsulated-Layout-Width' H:[UIView:0x15da7b90(0)]>,它规定了 的宽度>UIView at 0x15da7b90(同一个)为0.不能同时满足这个和上面那个,所以打破了这个.

                The other conflicting constraint is <NSLayoutConstraint:0x15dd2520 'UIView-Encapsulated-Layout-Width' H:[UIView:0x15da7b90(0)]>, which dictates the width of the UIView at 0x15da7b90 (same one) to be 0. It cannot satisfy both this one and the one above, so it breaks this one.

                我看到您的第一个约束是 NSAutoresizingMaskLayoutConstraint 类型之一,因此您可以尝试在视图上将 setTranslatesAutoresizingMaskIntoConstraints 设置为 false,这可能会删除第一个约束,从而消除冲突.

                I see that your first constraint is one of the type NSAutoresizingMaskLayoutConstraint, so you can try to set setTranslatesAutoresizingMaskIntoConstraints to false on your view, which will probably remove the first constraint, thus removing the conflict.

                其他有用的文档:

                • 视觉格式语言,Xcode 在日志中使用的格式有助于了解这种语言以便更好地调试它们.
                • 在 Xcode 中查看调试,有助于确定哪些视图在哪里以及在什么地址.
                • Visual Format Language, the format that Xcode uses in the log, helps to know this language to debug them better.
                • View Debugging in Xcode, helps to identify which views are where and at what address.

                这篇关于自定义键盘中的 iOS 8.3 'UIView-Encapsulated-Layout-Width'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:AutoLayout 理解乘数 下一篇:防止 Interface Builder 自动创建约束?

                相关文章

                <tfoot id='ECih8'></tfoot>
                  <bdo id='ECih8'></bdo><ul id='ECih8'></ul>

                <legend id='ECih8'><style id='ECih8'><dir id='ECih8'><q id='ECih8'></q></dir></style></legend>

                  1. <i id='ECih8'><tr id='ECih8'><dt id='ECih8'><q id='ECih8'><span id='ECih8'><b id='ECih8'><form id='ECih8'><ins id='ECih8'></ins><ul id='ECih8'></ul><sub id='ECih8'></sub></form><legend id='ECih8'></legend><bdo id='ECih8'><pre id='ECih8'><center id='ECih8'></center></pre></bdo></b><th id='ECih8'></th></span></q></dt></tr></i><div id='ECih8'><tfoot id='ECih8'></tfoot><dl id='ECih8'><fieldset id='ECih8'></fieldset></dl></div>

                    <small id='ECih8'></small><noframes id='ECih8'>