Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
168 views
in Technique[技术] by (71.8m points)

java - How to set gravity of row in KeyBoardView in android?

I am working to make a custom keyboard with android KeyboardView [android.inputmethodservice.KeyboardView]. Everything works fine except when I am trying to reduce the width of the key.

The Problem is: Here I can't make the bottom row gravity to center

enter image description here

The Code Behind this is:

<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
    android:keyWidth="10%p"
    android:horizontalGap="0px"
    android:verticalGap="0px"
    android:keyHeight="60dp">


    <Row android:rowEdgeFlags="bottom">
        <Key android:keyLabel="," android:keyWidth="5%p"  android:codes="44"/>
        <Key android:keyLabel="/" android:keyWidth="5%p"  android:codes="47"/>
        <Key android:keyLabel="SPACE" android:keyWidth="40%p" android:isRepeatable="true" android:codes="32"/>
        <Key android:keyLabel="DEL" android:keyWidth="10%p" android:isRepeatable="true" android:codes="-5"/>
        <Key android:keyLabel="DONE" android:keyWidth="10%p"  android:codes="-4"/>
    </Row>

</Keyboard>

So, Is there Any way to make this row gravity to center?

question from:https://stackoverflow.com/questions/66045213/how-to-set-gravity-of-row-in-keyboardview-in-android

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...