I'm trying to create a custom keyboard in ios8, using KeyboardViewController, but something seems wrong ——
When I try to get the height of the keyboard in viewDidLoad, I found that
self.view.frame
is {0,0,0,0}.So I try to define the height of keyboard myself, I try following code in viewDidLoad:
CGFloat _expandedHeight = size.height/4; NSLayoutConstraint *_heightConstraint = [NSLayoutConstraint constraintWithItem: self.view attribute: NSLayoutAttributeHeight relatedBy: NSLayoutRelationEqual toItem: nil attribute: NSLayoutAttributeNotAnAttribute multiplier: 0.0 constant: _expandedHeight]; [self.view addConstraint: _heightConstraint];
But I get this log in XCode output pane:
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.
Is that anybody can help me to solve any of this problem? thanks!