Chandarong Nuon
Chandarong Nuon

Reputation: 81

iOS Custom Keyboard Short Height

I am working on an iOS custom keyboard extension. My keyboard appears shorter than regular keyboard. See this:

Keyboard height is short

Please follow these steps to produce the result:

  1. Create an xCode project and add a Keyboard Extension target
  2. Add a new Storyboard file and change plist to use the newly added Storyboard. (You can follow a tutorial on Youtube "How To Create a Custom Keyboard Using Storyboard Xcode" )
  3. Add a UIViewController and drag 2 UIButtons to the view controller.
  4. Set constraints as in this: set top, left, bottom, same width and height constraints
  5. The UIButtons should be stretched and have equal height.
  6. Run it. The keyboard height is shorter than normal and the 2 buttons don't look as they do in the storyboard.

Development Environment:

Upvotes: 0

Views: 917

Answers (3)

Yury
Yury

Reputation: 11

I had similar issue (xcode 8.3), my keyboard would be smaller then the standard one (default settings). For organising the keys I use stack views which help layout the buttons without hard constraints. What I do to preserve the height of the keyboard is setting the relation of height constraints for each stack view to "Greater Than or Equal" (Default value is Equal): new settings and preserved keyboard height

best, Yury

Upvotes: 1

emiliomarin
emiliomarin

Reputation: 362

I had a similar problem and solved it by setting a new constrain for the height enter image description here

Upvotes: 0

ArtStyle
ArtStyle

Reputation: 353

Did you use constraint for height for your keyboard's view? If no, try to set this.

Also, put a checkmark to 'height' value in your screenshot for a buttons (or just make a ctrl-drag from the button to herself and choose 'height' item in the pop-up - this will work for keyboard's view too).

Upvotes: 0

Related Questions