Xcode10.1與Cordova項目,IOS12,輸入框遮擋解決(一)

Xcode9.4.1版本升級到Xcode10.1時,很順利的下進行,但是項目中需要輸入框的部分出現問題,在輸入時IOS手機的鍵盤遮擋輸入框問題,經過百度搜索,google搜索終於找到解決方法,方法有幾種。

下面時出現的錯誤:

 Can't find keyplane that supports type 5 for keyboard iPhone-PortraitChoco-PhonePad; using 20698_PortraitChoco_iPhone-Complex-Pad_Def

API error: <_UIKBCompatInputView: 0x7f92a9d50be0; frame = (0 0; 0 0); layer = <CALayer: 0x6000030f82e0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2019-03-03 09:36:20.541984-0500 HelloCordova[86860:8842449] API error: <_UIKBCompatInputView: 0x7f92a9d50be0; frame = (0 0; 0 0); layer = <CALayer: 0x6000030f82e0>> returned 0 width, assuming UIViewNoIntrinsicMetric
2019-03-03 09:36:20.567101-0500 HelloCordova[86860:8842449] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	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:0x60000132d4f0 h=-&- v=-&- _UIToolbarContentView:0x7f92a9d47080.width == UIToolbar:0x7f92a9d46c30.width   (active)>",
    "<NSLayoutConstraint:0x600001337570 H:|-(0)-[_UIButtonBarStackView:0x7f92a9d488b0]   (active, names: '|':_UIToolbarContentView:0x7f92a9d47080 )>",
    "<NSLayoutConstraint:0x6000013375c0 _UIButtonBarStackView:0x7f92a9d488b0.trailing == _UIToolbarContentView:0x7f92a9d47080.trailing   (active)>",
    "<NSLayoutConstraint:0x600001339b80 H:|-(20)-[_UIModernBarButton:0x7f92a9d60060]   (active, names: '|':_UIButtonBarButton:0x7f92a9d5fe10 )>",
    "<NSLayoutConstraint:0x60000133b340 H:[_UIModernBarButton:0x7f92a9d60060]-(>=8)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d5fe10 )>",
    "<NSLayoutConstraint:0x60000134e080 H:|-(>=5)-[_UIModernBarButton:0x7f92a9d60800]   (active, names: '|':_UIButtonBarButton:0x7f92a9d605b0 )>",
    "<NSLayoutConstraint:0x60000134df90 H:[_UIModernBarButton:0x7f92a9d60800]-(>=5)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d605b0 )>",
    "<NSLayoutConstraint:0x60000132c500 H:|-(8)-[_UIModernBarButton:0x7f92a9d61220'Done']   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c550 H:[_UIModernBarButton:0x7f92a9d61220'Done']-(20)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c910 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f92a9d5fe10.leading   (active)>",
    "<NSLayoutConstraint:0x60000132caf0 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f92a9d60d20.trailing   (active)>",
    "<NSLayoutConstraint:0x60000132cb40 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d5fe10]-(0)-[UIView:0x7f92a9d07080]   (active)>",
    "<NSLayoutConstraint:0x60000132cb90 'UISV-spacing' H:[UIView:0x7f92a9d07080]-(0)-[_UIButtonBarButton:0x7f92a9d605b0]   (active)>",
    "<NSLayoutConstraint:0x60000132cbe0 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d605b0]-(0)-[UIView:0x7f92a9d60b40]   (active)>",
    "<NSLayoutConstraint:0x60000132cc30 'UISV-spacing' H:[UIView:0x7f92a9d60b40]-(0)-[_UIButtonBarButton:0x7f92a9d60d20]   (active)>",
    "<NSLayoutConstraint:0x60000132d680 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7f92a9d46c30.width == 0   (active)>",
    "<NSLayoutConstraint:0x600001337430 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>",
    "<NSLayoutConstraint:0x6000013374d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide']-(0)-|(LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000133b340 H:[_UIModernBarButton:0x7f92a9d60060]-(>=8)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d5fe10 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-03-03 09:36:20.568777-0500 HelloCordova[86860:8842449] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	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:0x60000132d4f0 h=-&- v=-&- _UIToolbarContentView:0x7f92a9d47080.width == UIToolbar:0x7f92a9d46c30.width   (active)>",
    "<NSLayoutConstraint:0x600001337570 H:|-(0)-[_UIButtonBarStackView:0x7f92a9d488b0]   (active, names: '|':_UIToolbarContentView:0x7f92a9d47080 )>",
    "<NSLayoutConstraint:0x6000013375c0 _UIButtonBarStackView:0x7f92a9d488b0.trailing == _UIToolbarContentView:0x7f92a9d47080.trailing   (active)>",
    "<NSLayoutConstraint:0x60000134e080 H:|-(>=5)-[_UIModernBarButton:0x7f92a9d60800]   (active, names: '|':_UIButtonBarButton:0x7f92a9d605b0 )>",
    "<NSLayoutConstraint:0x60000134df90 H:[_UIModernBarButton:0x7f92a9d60800]-(>=5)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d605b0 )>",
    "<NSLayoutConstraint:0x60000132c500 H:|-(8)-[_UIModernBarButton:0x7f92a9d61220'Done']   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c550 H:[_UIModernBarButton:0x7f92a9d61220'Done']-(20)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c910 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f92a9d5fe10.leading   (active)>",
    "<NSLayoutConstraint:0x60000132caf0 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f92a9d60d20.trailing   (active)>",
    "<NSLayoutConstraint:0x60000132cb40 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d5fe10]-(0)-[UIView:0x7f92a9d07080]   (active)>",
    "<NSLayoutConstraint:0x60000132cb90 'UISV-spacing' H:[UIView:0x7f92a9d07080]-(0)-[_UIButtonBarButton:0x7f92a9d605b0]   (active)>",
    "<NSLayoutConstraint:0x60000132cbe0 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d605b0]-(0)-[UIView:0x7f92a9d60b40]   (active)>",
    "<NSLayoutConstraint:0x60000132cc30 'UISV-spacing' H:[UIView:0x7f92a9d60b40]-(0)-[_UIButtonBarButton:0x7f92a9d60d20]   (active)>",
    "<NSLayoutConstraint:0x60000132d680 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7f92a9d46c30.width == 0   (active)>",
    "<NSLayoutConstraint:0x600001337430 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>",
    "<NSLayoutConstraint:0x6000013374d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide']-(0)-|(LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000134df90 H:[_UIModernBarButton:0x7f92a9d60800]-(>=5)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d605b0 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2019-03-03 09:36:20.570157-0500 HelloCordova[86860:8842449] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	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:0x60000132d4f0 h=-&- v=-&- _UIToolbarContentView:0x7f92a9d47080.width == UIToolbar:0x7f92a9d46c30.width   (active)>",
    "<NSLayoutConstraint:0x600001337570 H:|-(0)-[_UIButtonBarStackView:0x7f92a9d488b0]   (active, names: '|':_UIToolbarContentView:0x7f92a9d47080 )>",
    "<NSLayoutConstraint:0x6000013375c0 _UIButtonBarStackView:0x7f92a9d488b0.trailing == _UIToolbarContentView:0x7f92a9d47080.trailing   (active)>",
    "<NSLayoutConstraint:0x60000132c500 H:|-(8)-[_UIModernBarButton:0x7f92a9d61220'Done']   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c550 H:[_UIModernBarButton:0x7f92a9d61220'Done']-(20)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>",
    "<NSLayoutConstraint:0x60000132c910 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.leading == _UIButtonBarButton:0x7f92a9d5fe10.leading   (active)>",
    "<NSLayoutConstraint:0x60000132caf0 'UISV-canvas-connection' UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'.trailing == _UIButtonBarButton:0x7f92a9d60d20.trailing   (active)>",
    "<NSLayoutConstraint:0x60000132cb40 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d5fe10]-(0)-[UIView:0x7f92a9d07080]   (active)>",
    "<NSLayoutConstraint:0x60000132cb90 'UISV-spacing' H:[UIView:0x7f92a9d07080]-(0)-[_UIButtonBarButton:0x7f92a9d605b0]   (active)>",
    "<NSLayoutConstraint:0x60000132cbe0 'UISV-spacing' H:[_UIButtonBarButton:0x7f92a9d605b0]-(0)-[UIView:0x7f92a9d60b40]   (active)>",
    "<NSLayoutConstraint:0x60000132cc30 'UISV-spacing' H:[UIView:0x7f92a9d60b40]-(0)-[_UIButtonBarButton:0x7f92a9d60d20]   (active)>",
    "<NSLayoutConstraint:0x60000132d680 'UIView-Encapsulated-Layout-Width' UIToolbar:0x7f92a9d46c30.width == 0   (active)>",
    "<NSLayoutConstraint:0x600001337430 'UIView-leftMargin-guide-constraint' H:|-(0)-[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide'](LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>",
    "<NSLayoutConstraint:0x6000013374d0 'UIView-rightMargin-guide-constraint' H:[UILayoutGuide:0x6000009189a0'UIViewLayoutMarginsGuide']-(0)-|(LTR)   (active, names: '|':_UIButtonBarStackView:0x7f92a9d488b0 )>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x60000132c550 H:[_UIModernBarButton:0x7f92a9d61220'Done']-(20)-|   (active, names: '|':_UIButtonBarButton:0x7f92a9d60d20 )>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.

解決方法幾種:
①Cordova命令安裝鍵盤插件cordova-plugin-keyboard
②Cordova命令安裝webview插件 cordova-plugin-ionic-webview
③Cordova命令安裝cordova-plugin-inappbrowser
網上幾種方法,我的問題使用上面方法②解決。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章