Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid: custom keyboard row is not centered
    text
    copied!<p>I am experimenting with creating a custom keyboard for Android. I am using the soft keyboard sample app as a starting point. My problem is that I am unable to center a row in the keyboard while other samples that I found on the net clearly work.</p> <p>My XML file looks like the following:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;&lt;Keyboard xmlns:android="http://schemas.android.com/apk/res/android" android:horizontalGap="@dimen/horizontal_gap" android:keyHeight="@dimen/key_height" android:keyWidth="10%p" android:verticalGap="@dimen/vertical_gap" &gt; &lt;Row&gt; &lt;Key android:codes="49" android:keyEdgeFlags="left" android:keyLabel="1" /&gt; &lt;Key android:codes="50" android:keyLabel="2" /&gt; &lt;Key android:codes="51" android:keyLabel="3" /&gt; &lt;Key android:codes="52" android:keyLabel="4" /&gt; &lt;Key android:codes="53" android:keyLabel="5" /&gt; &lt;Key android:codes="54" android:keyLabel="6" /&gt; &lt;Key android:codes="55" android:keyLabel="7" /&gt; &lt;Key android:codes="56" android:keyLabel="8" /&gt; &lt;Key android:codes="57" android:keyLabel="9" /&gt; &lt;Key android:codes="48" android:keyEdgeFlags="right" android:keyLabel="0" /&gt; &lt;/Row&gt; &lt;Row&gt; &lt;Key android:codes="1" android:keyEdgeFlags="left" android:keyLabel="q" /&gt; &lt;Key android:codes="2" android:keyLabel="w" /&gt; &lt;Key android:codes="3" android:keyLabel="e" /&gt; &lt;Key android:codes="4" android:keyLabel="r" /&gt; &lt;Key android:codes="5" android:keyLabel="t" /&gt; &lt;Key android:codes="6" android:keyLabel="y" /&gt; &lt;Key android:codes="-5" android:isRepeatable="true" android:keyEdgeFlags="right" android:keyIcon="@drawable/sym_keyboard_delete" /&gt; &lt;/Row&gt; &lt;Row&gt; &lt;Key android:codes="99" android:keyEdgeFlags="left" android:keyLabel="c" /&gt; &lt;Key android:codes="32" android:isRepeatable="true" android:keyIcon="@drawable/sym_keyboard_space" android:keyWidth="30%p" /&gt; &lt;Key android:codes="63" android:keyLabel="\?" android:keyWidth="@dimen/small_buttons" /&gt; &lt;Key android:codes="33" android:keyLabel="!" android:keyWidth="@dimen/small_buttons" /&gt; &lt;Key android:codes="46" android:keyLabel="." android:keyWidth="@dimen/small_buttons" /&gt; &lt;Key android:codes="44" android:keyEdgeFlags="right" android:keyLabel="," android:keyWidth="@dimen/small_buttons" /&gt; &lt;/Row&gt;&lt;/Keyboard&gt; </code></pre> <p>What's missing in order to make the second and the third rows centered?</p> <p>Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload