Navonil Das Navonil Das - 19 days ago 10
Java Question

How to set keyboard button size in Android

I was making a keyboard but the problem is that button size are too large and some button can't visible in The keyboard but their text are Visible.

So please Help ME

Till then I have created the keyboard layout and input function
That's all

Answer

Extend/Use Android's keyboard class, description from docs:

Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard consists of rows of keys.

Change button size on XML:

<Keyboard>
    android:keyWidth="%10p"
    android:keyHeight="50px"
    ...
</Keyboard>

Change button size programatically (those methods are protected):

setKeyHeight(int height);
setKeyWidth(int width)