keyboard 的间隙详解



    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="10%"
            android:horizontalGap="10%p"
            android:keyWidth="40%p"
            android:keyEdgeFlags="left"  />
        <Key android:codes="27941" android:keyLabel="10%"
            android:horizontalGap="10%p" android:keyWidth="40%p" />
    </Row>


    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="5%"
            android:horizontalGap="5%p" android:keyWidth="40%p"
            android:keyEdgeFlags="left"  />
        <Key android:codes="27941" android:keyLabel="10%"
            android:horizontalGap="10%p" android:keyWidth="40%p" />
    </Row>

    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="5%"
            android:horizontalGap="5%p" android:keyWidth="40%p"
            android:keyEdgeFlags="left"  />
        <Key android:codes="27941" android:keyLabel="5%"
            android:horizontalGap="5%p" android:keyWidth="40%p" />
    </Row>





    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="5%"
            android:horizontalGap="6.5%p" android:keyWidth="40%p"
            android:keyEdgeFlags="left"  />

        <Key android:codes="27941" android:keyLabel=""
            android:horizontalGap="0.2%p" android:keyWidth="0dp" />
        <Key android:codes="27941" android:keyLabel="5..%"
            android:horizontalGap="6.5%p" android:keyWidth="40%p" />
    </Row>




    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="7.5%"
            android:horizontalGap="7.5%p" android:keyWidth="40%p"
            />
        <Key android:codes="27941" android:keyLabel="7.5%"
            android:horizontalGap="7.5%p" android:keyWidth="40%p" />
    </Row>

    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="7.3%"
            android:horizontalGap="7.3%p" android:keyWidth="40%p"
            />
        <Key android:codes="27941" android:keyLabel="7.5%"
            android:horizontalGap="7.5%p" android:keyWidth="40%p" />
    </Row>




    <Row android:verticalGap="1.9%p">
        <Key android:codes="20140" android:keyLabel="0%"
            android:keyWidth="100%p"
            android:keyEdgeFlags="left"  />
    </Row>



image.png

间隙也就是两边的间隙,比如这里2个按钮一个占用了百分之80 那么屏幕的百分之20如何规划呢?
实际上应该让各自的边界都只有7.5% 然后中间 7.5x2=15 剩下的百分之5就是中间的,但是为什么图上面出现这种情况呢?我发现给按钮百分之百也是这样,所以问题不是出在这里了。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容