Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
169 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 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...