0
A
回答
2
嘗試:(viewDidAppear
是UIInputViewController
子類的方法)
- (void)viewDidAppear {
[super viewDidAppear];
CGFloat _expandedHeight = 250;
NSLayoutConstraint *_heightConstraint = [NSLayoutConstraint constraintWithItem:self.view attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:0.0 constant: _expandedHeight];
[self.view addConstraint: _heightConstraint];
}
警告:寫在viewDidAppear:
方法
這是行不通的。日誌:
2014-10-01 17:10:38.532 Coloured[7232:308451] 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)
(
"<NSLayoutConstraint:0x79829970 V:[UIInputView:0x79b2f660(250)]>",
"<NSLayoutConstraint:0x79824ea0 'UIView-Encapsulated-Layout-Height' V:[UIInputView:0x79b2f660(216)]>"
)
Will attempt to recover by breaking constraint
<NSLayoutConstraint:0x79829970 V:[UIInputView:0x79b2f660(250)]>
Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKit/UIView.h> may also be helpful.
相關問題
- 1. 自定義鍵盤不顯示自定義鍵盤iOS 8
- 2. iOS自定義鍵盤建議與UITextChecker
- 3. 自定義鍵盤建議
- 4. 自定義Android鍵盤中的建議
- 5. iOS 8自定義鍵盤擴展UIKeyboardType
- 6. ios 8自定義鍵盤UIViewServiceInterfaceErrorDomain?
- 7. 顯示ios鍵盤上方的建議工具欄
- 8. 顯示自定義鍵盤與故事板建立在iOS
- 9. iOS 8自定義鍵盤與外部藍牙鍵盤
- 10. 自定義鍵盤未顯示在Real IOS設備中
- 11. 如何顯示自定義鍵盤
- 12. 爲iOS鍵盤創建自定義Emojis
- 13. ios swift 3建立自定義鍵盤的底部標籤欄
- 14. IOS 8:無法在自定義鍵盤中使用println
- 15. 在iOS 8中使用原生預測的自定義鍵盤
- 16. ios自定義鍵盤
- 17. iOS的自定義鍵盤
- 18. iOS UITextField自定義鍵盤
- 19. 如何在IOS中自定義鍵盤
- 20. iOS中的自定義鍵盤顯示錯誤位置11
- 21. iOS8自定義鍵盤Settings.bundle不顯示
- 22. Android - 如何顯示自定義鍵盤
- 23. iOS 8自定義鍵盤防止關閉返回鍵
- 24. 如何顯示自定義鍵盤
- 25. iOS 8風景肖像模式中的自定義鍵盤
- 26. iOS 8自定義鍵盤自動佈局問題
- 27. iOS中的自定義鍵盤Objective-C
- 28. ios)如何創建自定義鍵盤上方的建議視圖
- 29. SearchView不顯示自定義建議
- 30. 如何在ios中創建自定義表情符號鍵盤?
嘗試不工作。請檢查編輯。 – 2014-10-01 11:52:33
確保你在'-viewDidAppear:'中試過了。不應該編輯我的帖子來顯示日誌(應該註釋而不是) – VietHung 2014-10-02 04:01:03
謝謝你!它正在工作 – Jamil 2017-07-05 15:31:20