EditText设置文本从左边框开始10dp [英] EditText set text start 10dp from left border

查看:171
本文介绍了EditText设置文本从左边框开始10dp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在android EditText小部件中设置从左边框开始的10dp文本?现在,当我键入某些内容时,它会粘在左侧,我需要放一些填充物.

Is possible in android EditText widget to set that text start 10dp from left border ? When I type something at the moment it is glued to left side and I need to put a little padding.

推荐答案

这可以通过android:padding属性来实现.

This can be achieved with the android:padding attribute.

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:padding="10dp" />

所有面都有10dp填充

has a 10dp padding on all sides

您可能只想指定左右填充.

you may just want to specify the left and right padding.

<EditText
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="10dp"
    android:paddingRight="10dp" />

将左右两侧的填充设为10dp.

Will make the padding on the left and right be 10dp.

这篇关于EditText设置文本从左边框开始10dp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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