如何让Android的EditText比默认的高度变小? [英] How to make android EditText smaller than default in height?

查看:809
本文介绍了如何让Android的EditText比默认的高度变小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何让Android的EditText比默认的高度更小?

How to make android EditText smaller than default in height?

如果我改变高度,我看不到我的文字,但对底部多余的空白。

If I change the height, I can't see my text, but it has extra blank on bottom.

推荐答案

EditText上有一个默认的填充集。

EditText has a default padding set.

试试这个,

<EditText 
    android:text="Any Text" 
    android:layout_width="fill_parent" 
    android:layout_height="16dp" 
    android:padding="2dp"
    android:background="#FFF"
    android:textSize="10dp"
/>

这篇关于如何让Android的EditText比默认的高度变小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆