In normal textview etc we can ellipsize the text by command:
android:ellipsize=""
I am customizing the android's soft keyboard. I want to know that is their a way to ellipsize the key of keyboard?
My code is:
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1px"
android:keyHeight="@dimen/key_height"
android:keyWidth="10%p"
android:verticalGap="-5%p" >
<!-- android:verticalGap="@dimen/verticalGap" > -->
<Row>
<Key
android:codes="555555"
android:horizontalGap="1.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="left"
android:keyHeight="@dimen/mic_key_height"
android:keyIcon="@drawable/voice_input"
android:keyWidth="28.5%p" />
<Key
android:codes="111111"
android:ellipsize="end"
android:horizontalGap="2%p"
android:keyEdgeFlags="right"
android:keyHeight="@dimen/templates_key_height"
android:keyWidth="67%p" />
</Row>
<Row>
<Key
android:codes="222222"
android:ellipsize="end"
android:horizontalGap="32%p"
android:keyEdgeFlags="right"
android:keyHeight="@dimen/templates_key_height"
android:keyWidth="67%p" />
</Row>
<Row>
<Key
android:codes="333333"
android:ellipsize="end"
android:horizontalGap="32%p"
android:keyEdgeFlags="right"
android:keyHeight="@dimen/templates_key_height"
android:keyWidth="67%p" />
</Row>
<Row>
<Key
android:codes="777777"
android:ellipsize="end"
android:horizontalGap="32%p"
android:keyEdgeFlags="right"
android:keyHeight="@dimen/templates_key_height"
android:keyWidth="67%p" />
</Row>
<Row>
<Key
android:codes="666666"
android:horizontalGap="1.5%p"
android:isModifier="true"
android:keyEdgeFlags="left"
android:keyHeight="@dimen/templates_key_height"
android:keyIcon="@drawable/voice_keyboard_enable"
android:keyWidth="28.5%p"
android:verticalGap="1.5%p" />
<Key
android:codes="444444"
android:horizontalGap="1.7%p"
android:keyEdgeFlags="right"
android:keyHeight="@dimen/templates_key_height"
android:keyLabel="@string/more_templates"
android:keyWidth="67%p"
android:verticalGap="1%p" />
</Row>
</Keyboard>
我正在定制安卓的软键盘。我想知道这是他们省略键盘键的一种方法吗?我动态地将文本添加到键中,但文本流出键边界。我想省略密钥。